Created
October 12, 2012 21:15
-
-
Save peteraritchie/3881573 to your computer and use it in GitHub Desktop.
sill socket beginsend example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
socket.BeginSend(memoryStream.GetBuffer(), 0, | |
(int) memoryStream.Length - 5, 0, | |
sendAr => | |
{ | |
socket.EndSend(sendAr); | |
socket.BeginSend( | |
memoryStream.GetBuffer(), | |
(int) memoryStream.Length - 5, | |
5, 0, | |
sendAr2 => | |
{ | |
socket.EndSend(sendAr2); | |
try | |
{ | |
socket.Shutdown( | |
SocketShutdown.Both); | |
socket.Close(); | |
} | |
catch (SocketException ex) | |
{ | |
Console.WriteLine(string.Format("1: SocketException {0}, {1}", Enum.GetName(typeof(SocketError), ex.SocketErrorCode), ex.Message)); | |
} | |
catch (Exception ex) | |
{ | |
.WriteLine(string.Format("1: {0}, {1}", ex.GetType().Name, ex.Message)); | |
} | |
}, null); | |
}, null); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment