Skip to content

Instantly share code, notes, and snippets.

@statianzo
Created September 24, 2011 18:12
Show Gist options
  • Save statianzo/1239653 to your computer and use it in GitHub Desktop.
Save statianzo/1239653 to your computer and use it in GitHub Desktop.
Fleck -> Behavior Chain
var allSockets = new List<IWebSocketConnection>();
var server = new WebSocketServer("ws://localhost:8181");
server.Start(socket =>
{
socket.OnOpen = () =>
{
allSockets.Add(socket);
};
socket.OnClose = () =>
{
allSockets.Remove(socket);
};
socket.OnMessage = message =>
{
//Send message to behavior chain
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment