Guest User

Untitled

a guest
Jul 20th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. socket.attach(http, { 'transports': ['polling','websocket'], 'allowUpgrades': true });
  2. socket.attach(https, { 'transports': ['polling','websocket'], 'allowUpgrades': true });
  3. socket.sockets.on('connection', function (socket) {
  4. // Process stuff here
  5. });
  6.  
  7. static async Task Connect(string uri)
  8. {
  9. ClientWebSocket sock = new ClientWebSocket();
  10. await sock.ConnectAsync(new Uri(uri), CancellationToken.None);
  11. }
  12.  
  13. System.AggregateException
  14. HResult=0x80131500
  15. Message=One or more errors occurred.
  16. Source=mscorlib
  17. StackTrace:
  18. at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
  19. at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
  20. at System.Threading.Tasks.Task.Wait()
  21. at WebsocketClientTest.Program.Main(String[] args) in C:SourcetestWebsocketClientTestProgram.cs:line 16
  22.  
  23. Inner Exception 1:
  24. WebSocketException: Unable to connect to the remote server
  25.  
  26. Inner Exception 2:
  27. WebException: The underlying connection was closed: The connection was closed unexpectedly.
Add Comment
Please, Sign In to add comment