コード例 #1
0
ファイル: OwinHandler.cs プロジェクト: tonyozr/Nowin
 public OwinHandler(OwinApp app, IDictionary <string, object> owinCapabilities, int handlerId)
 {
     _app = app;
     _owinCapabilities      = owinCapabilities;
     _handlerId             = handlerId;
     _environment           = new OwinEnvironment(this);
     ReqHeaders             = new Dictionary <string, string[]>(StringComparer.OrdinalIgnoreCase);
     RespHeaders            = new Dictionary <string, string[]>(StringComparer.OrdinalIgnoreCase);
     OnSendingHeadersAction = OnSendingHeadersMethod;
     _webSocketEnv          = new Dictionary <string, object>
     {
         { "websocket.SendAsync", (WebSocketSendAsync)WebSocketSendAsyncMethod },
         { "websocket.ReceiveAsync", (WebSocketReceiveAsync)WebSocketReceiveAsyncMethod },
         { "websocket.CloseAsync", (WebSocketCloseAsync)WebSocketCloseAsyncMethod },
         { "websocket.Version", "1.0" },
         { "websocket.CallCancelled", null }
     };
     DisconnectAction = () =>
     {
         _disconnected = true;
         StartWaitingTillEndOfAppFunc();
         Callback.CloseConnection();
     };
 }
コード例 #2
0
ファイル: OwinHandler.cs プロジェクト: EddieGarmon/Nowin
 public OwinHandler(OwinApp app, IDictionary<string, object> owinCapabilities, int handlerId)
 {
     _app = app;
     _owinCapabilities = owinCapabilities;
     _handlerId = handlerId;
     _environment = new OwinEnvironment(this);
     ReqHeaders = new Dictionary<string, string[]>(StringComparer.OrdinalIgnoreCase);
     RespHeaders = new Dictionary<string, string[]>(StringComparer.OrdinalIgnoreCase);
     OnSendingHeadersAction = OnSendingHeadersMethod;
     _webSocketEnv = new Dictionary<string, object>
         {
             {"websocket.SendAsync", (WebSocketSendAsync) WebSocketSendAsyncMethod},
             {"websocket.ReceiveAsync", (WebSocketReceiveAsync) WebSocketReceiveAsyncMethod},
             {"websocket.CloseAsync", (WebSocketCloseAsync) WebSocketCloseAsyncMethod},
             {"websocket.Version", "1.0"},
             {"websocket.CallCancelled", null}
         };
 }