Пример #1
0
        /// <summary>Initializes a new instance of the RealmClient class using the specified protocol.</summary>
        /// <param name="protocol">Protocol.</param>
        public RealmClient(RealmProtocol protocol)
        {
            if (protocol == null) throw new ArgumentNullException("protocol", "Protocol can not be null");

            _peer = new Peer(protocol);
            _peer.ConnectionStateChanged += OnConnectionStateChanged;
            _peer.PacketReceived += OnPacketReceived;
        }
Пример #2
0
 /// <summary>Initializes a new instance of the RealmService class.</summary>
 /// <param name="protocol">Protocol.</param>
 public RealmService(RealmProtocol protocol)
 {
     _protocol = protocol;
     _peer = new Listener(_protocol);
     _peer.PeerConnected += OnPeerConnectionAccepted;
 }