void Main() { var package = new ExamplePackage2(); tcpConnection = new TcpConnection(package); tcpConnection.OnConnecting += OnConnecting; tcpConnection.OnConnected += OnConnected; tcpConnection.OnReceiveMessage += OnReceiveMessage; tcpConnection.Connect("127.0.0.1", 999); }
void Main() { var package = new ExamplePackage2(); tcpConnection = new TcpConnection(package); tcpConnection.OnConnected += OnConnected; tcpConnection.OnReceiveMessage += OnReceiveMessage; tcpConnection.OnException += OnException; tcpConnection.Connect("127.0.0.1", 999); tcpConnection.Socket.NoDelay = true; tcpConnection.Socket.SendTimeout = 100; tcpConnection.Socket.ReceiveTimeout = 200; }