Exemplo n.º 1
0
 public void Send(string command)
 {
     SocketSender.Send(
         MaxUDPPacketSize,
         command,
         encodedCommand => UDPSocket.SendTo(encodedCommand, encodedCommand.Length, SocketFlags.None, IPEndpoint));
 }
        public void Send(string command)
        {
            if (!_socket.Connected)
            {
                lock (_socketLock)
                {
                    if (!_socket.Connected)
                    {
                        _socket.Connect(_endPoint);
                    }
                }
            }

            SocketSender.Send(_maxPacketSize, command,
                              encodedCommand => _socket.Send(encodedCommand));
        }