forked from hiram3512/HiSocket
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample3.cs
More file actions
29 lines (27 loc) · 734 Bytes
/
Example3.cs
File metadata and controls
29 lines (27 loc) · 734 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/***************************************************************
* Description:
*
* Documents: https://github.com/hiramtan/HiSocket
* Author: hiramtan@live.com
***************************************************************/
using HiSocket.Tcp;
namespace HiSocket.Example
{
/// <summary>
/// The recommend is use TcpConnection
/// </summary>
class Example3
{
TcpSocket tcp; //The recommend is use TcpConnection
void Connect()
{
tcp = new TcpSocket(1024);//set buffer size
tcp.OnReceiveBytes += OnReceive;
tcp.Connect("127.0.0.1", 999);
}
void OnReceive(byte[] bytes)
{
//split bytes here
}
}
}