/// <summary>
        /// Setup connection to use a SocketAsyncEventArgs setup to send/Receive
        /// </summary>
        /// <param name="acceptEventArgs"></param>
        private void ProcessAccept(SocketAsyncEventArgs acceptEventArgs)
        {
            IdentityUserToken token = (IdentityUserToken)acceptEventArgs.UserToken;

            token.LastTalked = ServerDiagnostics.Instance.Now;

            // Handle failure to accept connection
            if (acceptEventArgs.SocketError != SocketError.Success)
            {
                StartAccept();

                HandleBadAccept(acceptEventArgs, acceptEventArgs.SocketError);

                return;
            }

            _trace.HandleAccept(_settings.CustomState, token, acceptEventArgs.GetRemoteIpEndPoint());

            // Begin listening for more connections
            StartAccept();

            var workerEventArgs = GetWorkerFromAcceptEventArgs(acceptEventArgs);

            _watchDog.AddWatch(workerEventArgs);

            StartReceive(workerEventArgs);
        }
Example #2
0
 public void FailedTask(TU listenerStateObject, IdentityUserToken poolId, Exception e)
 {
 }
Example #3
0
 public void CompletedTask(TU listenerStateObject, IdentityUserToken poolId)
 {
 }
Example #4
0
 public void ExpiredTask(TU listenerStateObject, IdentityUserToken poolId)
 {
 }
Example #5
0
 public void StartingTask(TU listenerStateObject, IdentityUserToken poolId, DateTime requestedTime)
 {
 }
Example #6
0
 public void TimingOutConnection(TU listenerStateObject, IdentityUserToken poolId, IPEndPoint remote, byte[] recieveBuffer, int startIdx, int length, double awaitTime, double obtainLock, double connectionsCollected, double closeTime)
 {
 }
Example #7
0
 public void ClosingConnection(TU listenerStateObject, IdentityUserToken connectionId, IPEndPoint remote, bool toldToCloseByHander, bool closedByClient, SocketError closeReason)
 {
 }
Example #8
0
 public void Sent(TU listenerStateObject, IdentityUserToken poolId, IPEndPoint remote, int bytesSent)
 {
 }
Example #9
0
 public void Sending(TU listenerStateObject, IdentityUserToken connectionId, IPEndPoint remote, byte[] toTransfer, int offset, int length)
 {
 }
Example #10
0
 public void ReceivedGreaterThanBuffer(TU listenerStateObject, IdentityUserToken connectionId, IPEndPoint remote, byte[] recieveBuffer, int startIdx, int length)
 {
 }
Example #11
0
 public void HandleAccept(TU listenerStateObject, IdentityUserToken connectionId, IPEndPoint remote)
 {
 }
Example #12
0
 public void HandleBadAccept(TU listenerStateObject, IdentityUserToken connectionId, IPEndPoint remote, SocketError error)
 {
 }