nodejs / help

:sparkles: Need help with Node.js? File an Issue here. :rocket:
1.47k stars 280 forks source link

Nodejs Socket.io disconnection issue on specific mobile network india for game socket #4309

Closed Nilesh410451 closed 5 months ago

Nilesh410451 commented 10 months ago

Socket.io Version 4.7.2 in NODEJS

Best http socket.io client Version 2.8.6

Platform we are using Unity3d 2021.3.27f1

image_2023_12_07T07_07_20_779Z

Hi Team,

we are using above version for creating socket connection for our game.

The socket is working fine on all other mobile networks and WIFI except JIO 5G network in INDIA.

Once we connect the socket using JIO 5G network. The socket get disconnected multiple times without any reason and this is happens only on JIO 5G Network.

Please let us know how to resolve it

ERROR 1

Error in socket = {"message":"Request Finished with Error! Exception: Unable to read data from the transport connection: Connection reset by peer. at System.Net.Sockets.NetworkStream.Read (System.Byte[] buffer, System.Int32 offset, System.Int32 size) [0x000ac] in <160ff2a7112f4c5e8071e4724342c6b6>:0 \n at BestHTTP.Extensions.ReadOnlyBufferedStream.Read (System.Byte[] buffer, System.Int32 offset, System.Int32 size) [0x00069] in /Users/aaryanshgawade/Carrom365Android/Assets/ThirdPartyPlugins/Best HTTP/Source/Extensions/ReadOnlyBufferedStream.cs:48 \n at BestHTTP.Connections.BufferedReadNetworkStream.Read (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x00000] in /Users/aaryanshgawade/Carrom365Android/Assets/ThirdPartyPlugins/Best HTTP/Source/Connections/BufferedReadNetworkStream.cs:70 \n at BestHTTP.SecureProtocol.Org.BouncyCastle.Tls.RecordStream+Record.FillTo (System.IO.Stream input, System.Int32 length) [0x00002] in /Users/aaryanshgawade/Carrom365Android/Assets/ThirdPartyPlugins/Best HTTP/Source/SecureProtocol/tls/RecordStream.cs:495 \n at BestHTTP.SecureProtocol.Org.BouncyCastle.Tls.RecordStream+Record.ReadHeader (System.IO.Stream input) [0x00000] in /Users/aaryanshgawade/Carrom365Android/Assets/ThirdPartyPlugins/Best HTTP/Source/SecureProtocol/tls/RecordStream.cs:533 \n at BestHTTP.SecureProtocol.Org.BouncyCastle.Tls.RecordStream.ReadRecord () [0x00000] in /Users/aaryanshgawade/Carrom365Android/Assets/ThirdPartyPlugins/Best HTTP/Source/SecureProtocol/tls/RecordStream.cs:207 \n at BestHTTP.SecureProtocol.Org.BouncyCastle.Tls.TlsProtocol.SafeReadRecord () [0x00060] in /Users/aaryanshgawade/Carrom365Android/Assets/ThirdPartyPlugins/Best HTTP/Source/SecureProtocol/tls/TlsProtocol.cs:887 \n at BestHTTP.SecureProtocol.Org.BouncyCastle.Tls.TlsProtocol.ReadApplicationData (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x0004f] in /Users/aaryanshgawade/Carrom365Android/Assets/ThirdPartyPlugins/Best HTTP/Source/SecureProtocol/tls/TlsProtocol.cs:748 \n at BestHTTP.SecureProtocol.Org.BouncyCastle.Tls.TlsStream.ReadByte () [0x00000] in /Users/aaryanshgawade/Carrom365Android/Assets/ThirdPartyPlugins/Best HTTP/Source/SecureProtocol/tls/TlsStream.cs:76 \n at BestHTTP.WebSocket.Frames.WebSocketFrameReader.ReadByte (System.IO.Stream stream) [0x00000] in /Users/aaryanshgawade/Carrom365Android/Assets/ThirdPartyPlugins/Best HTTP/Source/WebSocket/Frames/WebSocketFrameReader.cs:128 \n at BestHTTP.WebSocket.Frames.WebSocketFrameReader.Read (System.IO.Stream stream) [0x00000] in /Users/aaryanshgawade/Carrom365Android/Assets/ThirdPartyPlugins/Best HTTP/Source/WebSocket/Frames/WebSocketFrameReader.cs:50 \n at BestHTTP.WebSocket.WebSocketResponse.ReceiveThreadFunc () [0x00018] in /Users/aaryanshgawade/Carrom365Android/Assets/ThirdPartyPlugins/Best HTTP/Source/WebSocket/WebSocketResponse.cs:408 "}

UnityEngine.Debug:LogError (object)

Carrom365.SocketController/<>c:b__38_2 (object) (at Assets/LUDO/Scripts/Common/SocketController.cs:219)

BestHTTP.SocketIO3.Socket/<>c__DisplayClass36_0`1:b__0 (object[]) (at Assets/ThirdPartyPlugins/Best HTTP/Source/SocketIO.3/Socket.cs:243)

BestHTTP.SocketIO3.Events.TypedEventTable:Call (string,object[]) (at Assets/ThirdPartyPlugins/Best HTTP/Source/SocketIO.3/Events/TypedEventTable.cs:95)

BestHTTP.SocketIO3.Socket:BestHTTP.SocketIO3.ISocket.EmitEvent (string,object[]) (at Assets/ThirdPartyPlugins/Best HTTP/Source/SocketIO.3/Socket.cs:483)

BestHTTP.SocketIO3.SocketManager:BestHTTP.SocketIO3.IManager.EmitEvent (string,object[]) (at Assets/ThirdPartyPlugins/Best HTTP/Source/SocketIO.3/SocketManager.cs:642)

BestHTTP.SocketIO3.SocketManager:BestHTTP.SocketIO3.IManager.EmitEvent (BestHTTP.SocketIO3.SocketIOEventTypes,object[]) (at Assets/ThirdPartyPlugins/Best HTTP/Source/SocketIO.3/SocketManager.cs:650)

BestHTTP.SocketIO3.SocketManager:BestHTTP.SocketIO3.IManager.EmitError (string) (at Assets/ThirdPartyPlugins/Best HTTP/Source/SocketIO.3/SocketManager.cs:662)

BestHTTP.SocketIO3.SocketManager:BestHTTP.SocketIO3.IManager.OnTransportError (BestHTTP.SocketIO3.Transports.ITransport,string) (at Assets/ThirdPartyPlugins/Best HTTP/Source/SocketIO.3/SocketManager.cs:483)

BestHTTP.SocketIO3.Transports.WebSocketTransport:OnError (BestHTTP.WebSocket.WebSocket,string) (at Assets/ThirdPartyPlugins/Best HTTP/Source/SocketIO.3/Transports/WebSocketTransport.cs:261)

BestHTTP.WebSocket.OverHTTP1:OnInternalRequestCallback (BestHTTP.HTTPRequest,BestHTTP.HTTPResponse) (at Assets/ThirdPartyPlugins/Best HTTP/Source/WebSocket/Implementations/OverHTTP1.cs:206)

BestHTTP.Core.RequestEventHelper:HandleRequestStateChange (BestHTTP.Core.RequestEventInfo) (at Assets/ThirdPartyPlugins/Best HTTP/Source/Core/RequestEvents.cs:569)

BestHTTP.Core.RequestEventHelper:ProcessQueue () (at Assets/ThirdPartyPlugins/Best HTTP/Source/Core/RequestEvents.cs:437)

BestHTTP.HTTPManager:OnUpdate () (at Assets/ThirdPartyPlugins/Best HTTP/Source/HTTPManager.cs:422)

BestHTTP.HTTPUpdateDelegator:CallOnUpdate () (at Assets/ThirdPartyPlugins/Best HTTP/Source/HTTPUpdateDelegator.cs:286)

BestHTTP.HTTPUpdateDelegator:Update () (at Assets/ThirdPartyPlugins/Best HTTP/Source/HTTPUpdateDelegator.cs:276

ERROR 2

Error in socket = {"message":"[BestHTTP.Connections.HTTP1Handler] Remote server closed the connection before sending response header! Previous request state: Processing. Connection state: Processing\n"}

UnityEngine.Debug:LogError (object)

ERROR 3

Error in socket = {"message":"Unable to write data to the transport connection: The socket has been shut down.\n at BestHTTP.SecureProtocol.Org.BouncyCastle.Tls.TlsProtocol.SafeWriteRecord (System.Int16 type, System.Byte[] buf, System.Int32 offset, System.Int32 len) [0x00036] in /Users/aaryanshgawade/Carrom365Android/Assets/ThirdPartyPlugins/Best HTTP/Source/SecureProtocol/tls/TlsProtocol.cs:939 \n at BestHTTP.SecureProtocol.Org.BouncyCastle.Tls.TlsProtocol.WriteApplicationData (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x000e5] in /Users/aaryanshgawade/Carrom365Android/Assets/ThirdPartyPlugins/Best HTTP/Source/SecureProtocol/tls/TlsProtocol.cs:1060 \n at BestHTTP.SecureProtocol.Org.BouncyCastle.Tls.TlsStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x00000] in /Users/aaryanshgawade/Carrom365Android/Assets/ThirdPartyPlugins/Best HTTP/Source/SecureProtocol/tls/TlsStream.cs:92 \n at BestHTTP.Extensions.WriteOnlyBufferedStream.Flush () [0x00009] in /Users/aaryanshgawade/Carrom365Android/Assets/ThirdPartyPlugins/Best HTTP/Source/Extensions/WriteOnlyBufferedStream.cs:35 \n at BestHTTP.HTTPRequest.SendOutTo (System.IO.Stream stream) [0x000b3] in /Users/aaryanshgawade/Carrom365Android/Assets/ThirdPartyPlugins/Best HTTP/Source/HTTPRequest.cs:1255 \n at BestHTTP.Connections.HTTP1Handler.RunHandler () [0x000b7] in /Users/aaryanshgawade/Carrom365Android/Assets/ThirdPartyPlugins/Best HTTP/Source/Connections/HTTP1Handler.cs:61 "}

Nilesh410451 commented 9 months ago

Hi Team, any update on the issue

thanks

RedYetiDev commented 5 months ago

If you're having an issue with a third-party library, please ask them for support.