Exemplo n.º 1
0
        public object ReceiveMessage()
        {
            object message = NetworkUtilities.Receive(Client);

            if (message == null)
            {
                Stop();
            }
            return(message);
        }
Exemplo n.º 2
0
        public object ReceiveMessage(ClientConnection client)
        {
            object dataReceived = NetworkUtilities.Receive(client);

            if (dataReceived == null)
            {
                throw new InvalidOperationException();
            }
            return(dataReceived);
        }
Exemplo n.º 3
0
 public ServerConnection(int port) : base(NetworkUtilities.GetLocalIPAddress(), port)
 {
     IsLocalConnection = true;
     Listener          = new TcpListener(IPAddress.Parse(SERVER_IP), PORT_NO);
 }
Exemplo n.º 4
0
 public void Send(object message)
 {
     NetworkUtilities.Send(message, Client);
 }
Exemplo n.º 5
0
 public new bool IsLocalConnection()
 {
     return(IPAddress == NetworkUtilities.GetLocalIPAddress());
 }
Exemplo n.º 6
0
 public void SendMessageTo(object message, ClientConnection client)
 {
     NetworkUtilities.Send(message, client);
 }