Skip to content
This repository was archived by the owner on Feb 15, 2023. It is now read-only.
This repository was archived by the owner on Feb 15, 2023. It is now read-only.

Reconnect fails #17

@sinokgr

Description

@sinokgr

Hi All,

I'm trying SocketIOSharp on mini project I'm working on, and I'm having one issue. Every time I restart the server, I'm getting an error.

Node.JS server below.

const express = require('express');
const app = express();
const http = require('http').Server(app);
const io = require('socket.io')(http);
const port = process.env.PORT || 80;

io.on('connection', (socket) => {
    console.log(socket);
});

http.listen(port, () => {
  console.log('listening on port:' + port);
});

Error

24/12/2021 18:28:19|Fatal|<>c__DisplayClass52_0.<ReadBytesAsync>b__0|System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
                             at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
                             at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
                             --- End of inner exception stack trace ---
                             at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
                             at WebSocketSharp.Ext.<>c__DisplayClass52_0.<ReadBytesAsync>b__0(IAsyncResult ar) in D:\repositories\uhm0311\websocket-sharp\websocket-sharp\Ext.cs:line 674 :
EngineIOSharp.Client.Transport.EngineIOPolling : EngineIOSharp.Common.EngineIOException: Error ---> System.Net.WebException: The remote server returned an error: (400) Bad Request.
   at EngineIOSharp.Client.Transport.EngineIOPolling.Request(EngineIOHttpMethod Method, Object EncodedPacket, Action`1 ErrorCallback) in D:\repositories\uhm0311\EngineIOSharp\EngineIOSharp\Client\Transport\EngineIOPolling.cs:line 156
   --- End of inner exception stack trace ---

Any ideas why this happening? Reconnect default settings seem fine, so I'm a bit confused. I searched online but I didn't find anything similar.

Many thanks,
Nick

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions