Esempio n. 1
0
 /// <summary>
 /// Uses WebSocket Protocol and accepts HTTP connections which comes with "Upgrade: websocket" header data
 /// </summary>
 public static ITwinoServer UseWebSockets(this ITwinoServer server,
                                          WebSocketReadyHandler readyAction,
                                          WebSocketMessageRecievedHandler messageAction)
 {
     return(UseWebSockets(server,
                          new MethodWebSocketConnectionHandler(null, readyAction, messageAction),
                          HttpOptions.CreateDefault()));
 }
Esempio n. 2
0
 /// <summary>
 /// Uses WebSocket Protocol and accepts HTTP connections which comes with "Upgrade: websocket" header data
 /// </summary>
 public static IHorseServer UseWebSockets(this IHorseServer server,
                                          WebSocketConnectedHandler connectedAction,
                                          WebSocketMessageRecievedHandler messageAction)
 {
     return(UseWebSockets(server,
                          new MethodWebSocketConnectionHandler(connectedAction, null, messageAction),
                          HttpOptions.CreateDefault()));
 }
Esempio n. 3
0
 /// <summary>
 /// Uses WebSocket Protocol and accepts HTTP connections which comes with "Upgrade: websocket" header data
 /// </summary>
 public static ITwinoServer UseWebSockets(this ITwinoServer server,
                                          WebSocketMessageRecievedHandler handlerAction,
                                          HttpOptions options)
 {
     return(UseWebSockets(server, new MethodWebSocketConnectionHandler(handlerAction), options));
 }
 public MethodWebSocketConnectionHandler(WebSocketConnectedHandler connectedHandler, WebSocketMessageRecievedHandler messageHandler)
 {
     _connectedHandler = connectedHandler;
     _messageHandler   = messageHandler;
 }
 public MethodWebSocketConnectionHandler(WebSocketMessageRecievedHandler handler)
     : this(null, handler)
 {
 }