Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- socket.attach(http, { 'transports': ['polling','websocket'], 'allowUpgrades': true });
- socket.attach(https, { 'transports': ['polling','websocket'], 'allowUpgrades': true });
- socket.sockets.on('connection', function (socket) {
- // Process stuff here
- });
- static async Task Connect(string uri)
- {
- ClientWebSocket sock = new ClientWebSocket();
- await sock.ConnectAsync(new Uri(uri), CancellationToken.None);
- }
- System.AggregateException
- HResult=0x80131500
- Message=One or more errors occurred.
- Source=mscorlib
- StackTrace:
- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
- at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
- at System.Threading.Tasks.Task.Wait()
- at WebsocketClientTest.Program.Main(String[] args) in C:SourcetestWebsocketClientTestProgram.cs:line 16
- Inner Exception 1:
- WebSocketException: Unable to connect to the remote server
- Inner Exception 2:
- WebException: The underlying connection was closed: The connection was closed unexpectedly.
Add Comment
Please, Sign In to add comment