public Session() { Interlocked.Increment(ref NextSessionId); SessionId = NextSessionId; AwaitableMethod = new AwaitableMethod(this); MethodType = NetworkMethodType.AsyncResult; _method = new SessionMethodAsyncResult(this); }
public Session(NetworkMethodType methodType) { Interlocked.Increment(ref NextSessionId); SessionId = NextSessionId; AwaitableMethod = new AwaitableMethod(this); MethodType = methodType; if (MethodType == NetworkMethodType.AsyncResult) _method = new SessionMethodAsyncResult(this); if (MethodType == NetworkMethodType.AsyncEvent) _method = new SessionMethodAsyncEvent(this); }
public Session(NetworkMethodType methodType) { Interlocked.Increment(ref NextSessionId); SessionId = NextSessionId; AwaitableMethod = new AwaitableMethod(this); MethodType = methodType; if (MethodType == NetworkMethodType.AsyncResult) { _method = new SessionMethodAsyncResult(this); } if (MethodType == NetworkMethodType.AsyncEvent) { _method = new SessionMethodAsyncEvent(this); } }