コード例 #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);
 }