Exemplo n.º 1
0
        public bool LogTimeout(
            [EventLogMethodParameter(Title = "Session Id", OrdinalInStruct = 0, TypeInStruct = "ushort")]
            uint sessionId,
            [EventLogMethodParameter(Title = "Session State", OrdinalInStruct = 1, TypeInStruct = "byte")]
            TcpStateEnum sessionState,
            [EventLogMethodParameter(Title = "Timeout Type", OrdinalInStruct = 2, TypeInStruct = "byte")]
            TcpSession.TcpTimeoutType timeoutType)
        {
            if ((debugOptions & LogTimeouts /* To Debugger */) != 0)
            {
                Core.Log("TCP: Ses{0,3} ({1}) Timeout of type '{2}' occurred",
                         sessionId,
                         TcpState.TcpStateNames[(uint)sessionState],
                         TcpSession.TcpTimeoutTypeNames[(uint)timeoutType]);
            }

            if ((ControlFlags & LogTimeouts) != 0)
            {
                TimeoutEntry timeoutEntry =
                    new TimeoutEntry(sessionId, sessionState, timeoutType);

                unsafe
                {
                    return(LogEntry(ControlFlags,
                                    timeoutTypeHandle,
                                    (byte *)&timeoutEntry,
                                    sizeof(TimeoutEntry)) != 0);
                }
            }

            return(false);
        }
Exemplo n.º 2
0
 public TimeoutEntry(uint sessionId, TcpStateEnum sessionState, TcpSession.TcpTimeoutType timeoutType)
 {
     this.sessionId    = (ushort)sessionId;
     this.sessionState = (byte)sessionState;
     this.timeoutType  = (byte)timeoutType;
 }