Created
April 25, 2017 00:50
-
-
Save mushfiqweb/0751e560c936955db14e7c77ece4fcbb to your computer and use it in GitHub Desktop.
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 socket = tcpClient.Client; | |
byte[] buffer = new byte[12]; // length of the text "Hello world!" | |
try | |
{ // receive data with timeout 10s | |
MyClass.Receive(socket, buffer, 0, buffer.Length, 10000); | |
string str = Encoding.UTF8.GetString(buffer, 0, buffer.Length); | |
} | |
catch (Exception ex) { /* ... */ } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment