public WebSocketConnection(WebSocketClient supportingClient, WebSocketUser newUser, Logger logger) //, WebSocketSettings settings, WebSocketUser newUser) { client = supportingClient; this.logger = logger; ID = GenerateID(); User = newUser; fragmentBuffer = new byte[Client.MaxReceiveSize]; }
public WebSocketSpinner(WebSocketClient supportingClient, WebSocketUser newUser, WebSocketSettings settings) : base("WebsocketSpinner", settings.ShutdownTimeout) { connection = new WebSocketConnection(supportingClient, newUser, settings.LogProvider); this.settings = settings; //Fix up the user so it does what we want. User.SetSendPlaceholder((message) => { if(connection.Client != null) connection.Client.QueueMessage(message); }); User.SetCloseSelfPlaceholder(() => { connection.Client.QueueRaw(WebSocketFrame.GetCloseFrame().GetRawBytes()); }); }
public WebSocketConnectionAsync(WebSocketClient client, WebSocketUser user, Logger logger) : base(client, user, logger) { }