/// <summary>
        /// Initializes a new instance of the <see cref="BaseSocketConnection"/> class.
        /// </summary>
        /// <param name="host">The host.</param>
        /// <param name="creator">The creator.</param>
        /// <param name="socket">The socket.</param>
        protected BaseSocketConnection(BaseSocketConnectionHost host, BaseSocketConnectionCreator creator, System.Net.Sockets.Socket socket)
        {
            //----- Connection Id!
            FId = host.GetConnectionId();

            FSyncData   = new object();
            FReadBytes  = 0;
            FWriteBytes = 0;

            FHost    = host;
            FCreator = creator;
            FSocket  = socket;

            FSyncActive = new Object();
            FActive     = false;

            FWriteOV = new SocketAsyncEventArgs();
            FReadOV  = new SocketAsyncEventArgs();

            FWriteQueue         = new Queue <MessageBuffer>();
            FWriteQueueHasItems = false;

            FSyncReadPending = new object();
            FReadPending     = false;

            FSyncEventProcessing = new object();
            FEventProcessing     = EventProcessing.epNone;

            FLastAction = new DateTimeOffset(DateTime.Now);

            FUserData  = null;
            FEncryptor = null;
            FDecryptor = null;
        }
Beispiel #2
0
        internal BaseSocketConnection(BaseSocketConnectionHost host, BaseSocketConnectionCreator creator, Socket socket)
        {
            //----- Connection Id!
            FId         = host.GetConnectionId();
            FHost       = host;
            FCreator    = creator;
            FSocket     = socket;
            FActive     = false;
            FSyncActive = new Object();

            FWriteQueue = new Queue <MessageBuffer>();

            FWriteQueueHasItems = false;
            FReadCanEnqueue     = true;

            FReadCount     = 0;
            FSyncReadCount = new object();

            FLastAction = DateTime.Now;

            FCustomData = null;
            FEncryptor  = null;
            FDecryptor  = null;
        }
        internal BaseSocketConnection(BaseSocketConnectionHost host, BaseSocketConnectionCreator creator, Socket socket)
        {

            //----- Connection Id!
            FId = host.GetConnectionId();
            FHost = host;
            FCreator = creator;
            FSocket = socket;
            FActive = false;
            FSyncActive = new Object();

            FWriteQueue = new Queue<MessageBuffer>();

            FWriteQueueHasItems = false;
            FReadCanEnqueue = true;

            FReadCount = 0;
            FSyncReadCount = new object();

            FLastAction = DateTime.Now;

            FCustomData = null;
            FEncryptor = null;
            FDecryptor = null;

        }