In my latest book, I had a code snippet that wasn't working properly with the RTM bits. I've fixed it in the online version, in case any of you were trying to use it. It was the code that used NegotiateStream to establish a logon for a user given her user name and password. You basically act out both sides of the negotiation, but in order to do this, you need to use a full duplex stream (my original code was using a MemoryStream, which isn't duplex). You also need asynchrony. Simply calling AuthenticateAsClient followed by AuthenticateAsServer won't work, because it's assumed these bits of code are running on different threads (usually in different processes on different machines, even!) To solve this, I use async sockets with TcpListener on the loopback address.
Hope this helps!
Posted
Jan 13 2006, 06:36 AM
by
keith-brown