using (TcpClientConnection client = new TcpClientConnection()) { client.NetworkStream = new NetworkStream(); client.TimeOut = 60000; client.Open(HostResolver.GetIPAddress("127.0.0.1"), 2110); MessageBox.Show("Client connected"); using (StringStream data = new StringStream("Data to be sent")) { client.WriteData(data); data.SetLength(0); client.IsReadUntilClose = true; client.ReadData(data); MessageBox.Show(data.DataString); } client.Close(true); MessageBox.Show("Client disconnected"); }
using (TcpServerConnection server = new TcpServerConnection()) { server.NetworkStream = new NetworkStream(); server.TimeOut = 60000; server.BatchSize = 8192; server.Open(2110); server.Accept(); textBox1.Text += "connected\r\n"; using (StringStream data = new StringStream()) { server.ReadData(data); data.Position = 0; server.WriteData(data); } textBox1.Text += "read done\r\n"; server.Close(false); textBox1.Text += "closed\r\n"; }
Trouble logging in? Simply enter your email address OR username in order to reset your password.
For faster and more reliable delivery, add admin@clevercomponents.com to your trusted senders list in your email software.