/// <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);
        }
Beispiel #2
0
 public void FailedTask(TU listenerStateObject, IdentityUserToken poolId, Exception e)
 {
 }
Beispiel #3
0
 public void CompletedTask(TU listenerStateObject, IdentityUserToken poolId)
 {
 }
Beispiel #4
0
 public void ExpiredTask(TU listenerStateObject, IdentityUserToken poolId)
 {
 }
Beispiel #5
0
 public void StartingTask(TU listenerStateObject, IdentityUserToken poolId, DateTime requestedTime)
 {
 }
Beispiel #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)
 {
 }
Beispiel #7
0
 public void ClosingConnection(TU listenerStateObject, IdentityUserToken connectionId, IPEndPoint remote, bool toldToCloseByHander, bool closedByClient, SocketError closeReason)
 {
 }
Beispiel #8
0
 public void Sent(TU listenerStateObject, IdentityUserToken poolId, IPEndPoint remote, int bytesSent)
 {
 }
Beispiel #9
0
 public void Sending(TU listenerStateObject, IdentityUserToken connectionId, IPEndPoint remote, byte[] toTransfer, int offset, int length)
 {
 }
Beispiel #10
0
 public void ReceivedGreaterThanBuffer(TU listenerStateObject, IdentityUserToken connectionId, IPEndPoint remote, byte[] recieveBuffer, int startIdx, int length)
 {
 }
Beispiel #11
0
 public void HandleAccept(TU listenerStateObject, IdentityUserToken connectionId, IPEndPoint remote)
 {
 }
Beispiel #12
0
 public void HandleBadAccept(TU listenerStateObject, IdentityUserToken connectionId, IPEndPoint remote, SocketError error)
 {
 }