Hi, I am curious where can I find out that AcceptClient as a callback of BeginAcceptSocket needs to have IAsyncResult as a parameter. In the MSDN article there is only mentioned that return value of BeginAcceptSocket is IAsyncresult. But how could I know that it has to be passed to callback? Thanks!
public server(int port)
{
listener = new TcpListener(System.Net.IPAddress.Any, port);
listener.BeginAcceptSocket(this.AcceptClient,null);
}
private void AcceptClient(IAsyncResult ar)
{
}