Hello, i try to write a simple asynchronous client/server apps. I know how do it using callback, but i want to invistigate how write client+server using await/async and c# 5.0. Please, help me. It should be simple. Only connect and transfer some bytes.
I know that this can be done using Tasks.
Something like this:
Code:
public static Task ConnectAsync(this Socket socket, EndPoint remoteEP)
{
return Task.Factory.FromAsync(socket.BeginConnect, socket.EndConnect, remoteEP, null);
}
I try to find some examples, but this has no effect.
FYI. without tcplistener and NetworkStream.