Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void initSockets()
- {
- System.Net.Sockets.TcpClient clientSocket = new System.Net.Sockets.TcpClient();
- IPEndPoint endPoint = new IPEndPoint(IPAddress.Parse("192.168.1.4"), 18041);
- Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
- byte[] data = new byte[1024];
- data = Encoding.ASCII.GetBytes("TESTING");
- clientSocket.Connect("192.168.1.4", 18042);
- //sock.Connect(endPoint);
- //155.42.86.237
- sock.Send(data, data.Length, SocketFlags.None);
- while (true)
- {
- int receivedDataLength = sock.Receive(data);
- string stringData = Encoding.ASCII.GetString(data, 0, receivedDataLength);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement