MTSC  1.0.5
Build TCP servers out of modules with handlers for communication, exception and logging.
BroadcastModule.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using MTSC.Server;
5 using MTSC.Server.Handlers;
6 
8 {
10  {
12  {
13 
14  }
15 
17  {
18 
19  }
20 
22  {
23  receivedMessage.Masked = false;
24  //receivedMessage.Opcode = WebsocketMessage.Opcodes.Text;
25  foreach(ClientData otherClient in handler.webSockets.Keys)
26  {
27  handler.QueueMessage(otherClient, receivedMessage);
28  }
29  return false;
30  }
31  }
32 }
bool HandleReceivedMessage(Server.Server server, WebsocketHandler handler, ClientData client, WebsocketMessage receivedMessage)
Handle a received message.
void ConnectionClosed(Server.Server server, WebsocketHandler handler, ClientData client)
Called when a connection has been closed.
Structure containing client information.
Definition: Server.cs:402
Class containing the bytes of a websocket received message.
Server()
Creates an instance of server with default values.
Definition: Server.cs:68
Basic server class to handle TCP connections.
Definition: Server.cs:20
Definition: Client.cs:14
void QueueMessage(ClientData client, byte[] message)
Send a message to the client.
void ConnectionInitialized(Server.Server server, WebsocketHandler handler, ClientData client)
Called when a connection has been initialized.