I am working on TCP multithread server and client. I found some codes from Microsoft websites: http://msdn.microsoft.com/en-us/library/system.net.sockets.socketasynceventargs.aspx
However I got the following error:
The type or namespace name 'AsyncUserToken' could not be found (are you missing a using directive or an assembly reference?)
I cant find what namespace to include even I searched it on Google, here are those I currently have:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Threading;
Thanks for help.
The AsyncUserToken
class is not part of the .NET framework. It looks like it has been forgotten in the Microsoft sample.
You can create yourself the AsyncUserToken
class with a Socket
property (corresponding to the socket used to perform the I/O operations) :
internal class AsyncUserToken
{
public System.Net.Sockets.Socket Socket { get; set; }
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With