public static class SocketExtensions
{
public static SocketAwaitable ReceiveAsync(this Socket socket,
SocketAwaitable awaitable)
{
awaitable.Reset();
if (!socket.ReceiveAsync(awaitable.m_eventArgs))
awaitable.m_wasCompleted = true;
return awaitable;
}public static SocketAwaitable SendAsync(this Socket socket,
SocketAwaitable awaitable)
{
awaitable.Reset();
if (!socket.SendAsync(awaitable.m_eventArgs))
awaitable.m_wasCompleted = true;
return awaitable;
}// ...
}
Thursday, May 30, 2013
Awaiting Socket Operations - .NET Parallel Programming - Site Home - MSDN Blogs
Awaiting Socket Operations - .NET Parallel Programming - Site Home - MSDN Blogs:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment