Exemple #1
0
        public void SendTo(UdpConnectionEntity connection, NetworkMessage message)
        {
            if (connection.IsDisposed)
            {
                throw new ObjectDisposedException(nameof(UdpConnectionEntity));
            }

            SendTo(connection.EndPoint, NetworkProtocol.GetCurrentProtocol().OnSerializeMessage(message));
        }
 public void Send(NetworkMessage message)
 {
     Send(NetworkProtocol.GetCurrentProtocol().OnSerializeMessage(message));
 }
 internal TcpConnectionEntity(Socket socket, uint id) : base(id)
 {
     _socket = socket;
     _buffer = new byte[NetworkProtocol.GetCurrentProtocol().NetworkBufferLength];
     _reader = new BasicReader();
 }
Exemple #4
0
 protected TcpClientEntity(string ip, int port) : base(ip, port)
 {
     _buffer = new byte[NetworkProtocol.GetCurrentProtocol().NetworkBufferLength];
     _reader = new BasicReader();
 }