static void StartReceive(Object obj) { TCPClientManager tcpClient = obj as TCPClientManager; byte[] recBytes = new byte[TCPPacket.RECV_MAX_SIZE]; while (true) { try { if (tcpClient._Socket == null) { continue; } int byteSize = tcpClient._Socket.Receive(recBytes, recBytes.Length, 0); if (byteSize <= 0) { continue; } tcpClient._TCPPacket.WriteData(recBytes, 0, byteSize); } catch (Exception ex) { } } }
static void Main() { tcpClient = new TCPClientManager("47.100.168.140", 4402); tcpClient.InitTcpClient(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Login()); }