Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void sendMessage(byte[] command,int id)
- {
- Socket s = ClientsControl.ClientList[id]._socket;
- s.Send(command);
- Console.WriteLine("Sent: " + command + " to " + s.RemoteEndPoint);
- }
- public void prepareSend(EndPoint clientIp)
- {
- s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
- remoteEnd = clientIp;
- while(!s.Connected)
- {
- //maybe add timeout
- Thread.Sleep(1000);
- try
- {
- s.Connect(remoteEnd);
- }
- catch { }
- Console.WriteLine("Successful connection for sending at " + remoteEnd);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement