Well, at first glance the object initializer isn't formatted correctly. How about this:
Dim aServer = New WebSocketServer(81, IPAddress.Any) With { _
.OnReceive = OnReceive,
.OnSend = OnSend,
.OnConnect = OnConnect,
.OnConnected = OnConnected,
.OnDisconnect = OnDisconnect,
.TimeOut = New TimeSpan(0, 5, 0)
}
aServer.Start()
Also, looking at your fix, you are creating new OnEventDelegates. Have you tried simply passing each one AddressOf yourCallbackSub? Ie:
Dim aServer = New WebSocketServer(81, IPAddress.Any) With { _
.OnReceive = AddressOf OnDataReceive,
.OnSend = AddressOf OnDataSend,
.OnConnect = AddressOf OnUserConnect,
.OnConnected = AddressOf ?,
.OnDisconnect = AddressOf OnUserDisconnect,
.TimeOut = New TimeSpan(0, 5, 0)
}
aServer.Start()
- Pete