/// <summary>
        /// Internal function that called from the Socket class. It will send out the packet instantly, or if no transport is available it will store
        /// the packet in the OfflinePackets list.
        /// </summary>
        void IManager.SendPacket(Packet packet)
        {
            ITransport trans = SelectTransport();

            if (trans != null)
            {
                try
                {
                    trans.Send(packet);
                }
                catch (Exception ex)
                {
                    (this as IManager).EmitError(SocketIOErrors.Internal, ex.Message + " " + ex.StackTrace);
                }
            }
            else
            {
                if (OfflinePackets == null)
                {
                    OfflinePackets = new List <Packet>();
                }

                // The same packet can be sent through multiple Sockets.
                OfflinePackets.Add(packet.Clone());
            }
        }
Beispiel #2
0
        /// <summary>
        /// Internal function that called from the Socket class. It will send out the packet instantly, or if no transport is available it will store
        /// the packet in the OfflinePackets list.
        /// </summary>
        void IManager.SendPacket(Packet packet)
        {
            HTTPManager.Logger.Information("SocketManager", "SendPacket " + packet.ToString());

            ITransport trans = SelectTransport();

            if (trans != null)
            {
                try
                {
                    trans.Send(packet);
                }
                catch (Exception ex)
                {
                    (this as IManager).EmitError(SocketIOErrors.Internal, ex.Message + " " + ex.StackTrace);
                }
            }
            else
            {
                HTTPManager.Logger.Information("SocketManager", "SendPacket - Offline stashing packet");

                if (OfflinePackets == null)
                {
                    OfflinePackets = new List <Packet>();
                }

                // The same packet can be sent through multiple Sockets.
                OfflinePackets.Add(packet.Clone());
            }
        }
        void IManager.SendPacket(Packet packet)
        {
            ITransport transport = this.SelectTransport();

            if (transport != null)
            {
                try
                {
                    transport.Send(packet);
                }
                catch (Exception ex)
                {
                    ((IManager)this).EmitError(SocketIOErrors.Internal, ex.Message + " " + ex.StackTrace);
                }
            }
            else
            {
                if (this.OfflinePackets == null)
                {
                    this.OfflinePackets = new List <Packet>();
                }
                this.OfflinePackets.Add(packet.Clone());
            }
        }
Beispiel #4
0
        /// <summary>
        /// Internal function that called from the Socket class. It will send out the packet instantly, or if no transport is available it will store
        /// the packet in the OfflinePackets list.
        /// </summary>
        void IManager.SendPacket(Packet packet)
        {
            ITransport trans = SelectTransport();

            if (trans != null)
            {
                try
                {
                    trans.Send(packet);
                }
                catch(Exception ex)
                {
                    (this as IManager).EmitError(SocketIOErrors.Internal, ex.Message + " " + ex.StackTrace);
                }
            }
            else
            {
                if (OfflinePackets == null)
                    OfflinePackets = new List<Packet>();

                // The same packet can be sent through multiple Sockets. 
                OfflinePackets.Add(packet.Clone());
            }
        }