예제 #1
0
        public object ReceiveMessage()
        {
            object message = NetworkUtilities.Receive(Client);

            if (message == null)
            {
                Stop();
            }
            return(message);
        }
예제 #2
0
        public object ReceiveMessage(ClientConnection client)
        {
            object dataReceived = NetworkUtilities.Receive(client);

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