I've been away from C# for a while and now that I'm trying to read some code, I'm having a hard time find the meaning of it:
var server = new WebSocketServer("ws://localhost:8181");
server.Start(socket =>
{
socket.OnOpen = () =>
{
Console.WriteLine("Open!");
allSockets.Add(socket);
};
socket.OnClose = () =>
{
Console.WriteLine("Close!");
allSockets.Remove(socket);
};
socket.OnMessage = message =>
{
Console.WriteLine(message);
allSockets.ToList().ForEach(s => s.Send("Echo: " + message));
};
});
What's the name for socket => { .. }
syntax and where can I find some text on it? And in which version of C# is it introduced? Is the = () => { .. }
the same?