コード例 #1
0
ファイル: SessionHandler.cs プロジェクト: hpatel98/SCAMP
        public SessionHandler(HttpContext context, SessionFactory factory)
        {
            if (!context.IsWebSocketRequest)
                throw new ApplicationException("context is not a websocket context");

            this.Context = context;
            this.Factory = factory;

            this.getSocket = context.AcceptWebSocketAsync();
        }
コード例 #2
0
ファイル: Session.cs プロジェクト: hpatel98/SCAMP
 public Session(SessionFactory factory, WebSocket ws)
 {
     this.Factory = factory;
     this.Id = Guid.NewGuid();
     this.Socket = ws;
     this.Source = new CancellationTokenSource();
     this.Buffer = new byte[BufferSize];
     receiver = new ArraySegment<byte>(this.Buffer);
     this.Result = null;
 }