IPEndPoint ipep = new IPEndPoint(IPAddress.Parse(Ip), Convert.ToInt32(port)); Socket server = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); public void GetConnectedServer() { server.Connect(ipep); } public void SendData(byte[] data) { int sentbytes = server.Send(data,SocketFlags.None); } public byte[] RecvResponse() { byte[] recBuffer1 = new byte[1024]; try { int recvBytes = server.Receive(recBuffer1, SocketFlags.Peek); recBuffer1=new byte[recvBytes]; recvBytes = server.Receive(recBuffer1, 0, recvBytes, SocketFlags.None); } catch(SocketException ex) { throw ex; } return recBuffer1; }
Nagle
TCP_NODELAY
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)