socketio / socketio/socket.io

Socket Disconnection issue on Specific Mobile Network on JIO 5g network in INDIA

Open
#4,891 16 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
TypeScript
Stars
63.2k
Forks
10.3k
Avg merge
11d 20h
Merged PRs (30d)
2

Description

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 "}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting Assets/LUDO/Scripts/Common/SocketController.cs at line 219 and the BestHTTP WebSocket, TLS, and HTTP stack traces included in the report. Reproduce the disconnect on JIO 5G and a control network, then narrow down whether the cause is in the client, Socket.IO server, or network path. Done means a confirmed cause with a reproducible fix or documented external-network limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, unity
Domain
mobile-dev, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.