public GladNetOutboundS2SPeer(GladNetAppBase appBase, INetworkMessageReceiver reciever, IDeserializerStrategy deserializationStrat, 
			IDisconnectionServiceHandler disconnectionService)
				: base(appBase)
		{
			Throw<ArgumentNullException>.If.IsNull(appBase)?.Now(nameof(appBase));
			Throw<ArgumentNullException>.If.IsNull(reciever)?.Now(nameof(reciever));
			Throw<ArgumentNullException>.If.IsNull(deserializationStrat)?.Now(nameof(deserializationStrat));
			Throw<ArgumentNullException>.If.IsNull(disconnectionService)?.Now(nameof(disconnectionService));

			disconnectionServiceHandler = disconnectionService;
			networkReciever = reciever;
			deserializer = deserializationStrat;

			//Publish that we are connecting
			networkReciever.OnNetworkMessageReceive(new PhotonStatusMessageAdapter(NetStatus.Connecting), null);
		}
Esempio n. 2
0
        public GladNetOutboundS2SPeer(GladNetAppBase appBase, INetworkMessageReceiver reciever, IDeserializerStrategy deserializationStrat,
                                      IDisconnectionServiceHandler disconnectionService)
            : base(appBase)
        {
            Throw <ArgumentNullException> .If.IsNull(appBase)?.Now(nameof(appBase));

            Throw <ArgumentNullException> .If.IsNull(reciever)?.Now(nameof(reciever));

            Throw <ArgumentNullException> .If.IsNull(deserializationStrat)?.Now(nameof(deserializationStrat));

            Throw <ArgumentNullException> .If.IsNull(disconnectionService)?.Now(nameof(disconnectionService));

            disconnectionServiceHandler = disconnectionService;
            networkReciever             = reciever;
            deserializer = deserializationStrat;

            //Publish that we are connecting
            networkReciever.OnNetworkMessageReceive(new PhotonStatusMessageAdapter(NetStatus.Connecting), null);
        }