SmartFox Server 2X Web Socket Problem

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

User avatar
mete2221
Posts: 57
Joined: 30 Aug 2017, 17:01

SmartFox Server 2X Web Socket Problem

Postby mete2221 » 28 Jan 2020, 16:56

SmartFox Server 2X closing Web Socket's connection with 1006 error code.
This problem usually happens while large packet transmission

Error writing to client: { Id: 144, Type: WEBSOCKET, Logged: Yes, IP: 127.0.0.1:54572 }
java.lang.InterruptedException
at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1326)
at java.util.concurrent.Semaphore.tryAcquire(Semaphore.java:409)
at org.apache.tomcat.util.net.SocketWrapperBase.vectoredOperation(SocketWrapperBase.java:1451)
at org.apache.tomcat.util.net.SocketWrapperBase.write(SocketWrapperBase.java:1403)
at org.apache.tomcat.util.net.SocketWrapperBase.write(SocketWrapperBase.java:1374)
at org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.doWrite(WsRemoteEndpointImplServer.java:91)
at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:494)
at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessage(WsRemoteEndpointImplBase.java:381)
at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendBytesByCompletion(WsRemoteEndpointImplBase.java:151)
at org.apache.tomcat.websocket.WsRemoteEndpointAsync.sendBinary(WsRemoteEndpointAsync.java:65)
at sfs2x.ws.tomcat.websocket.SFS2XWSService._write(SFS2XWSService.java:338)
at sfs2x.ws.tomcat.websocket.SFS2XWSService.write(SFS2XWSService.java:331)
at com.smartfoxserver.bitswarm.websocket.tomcat.WebSocketBinaryProtocolCodec.onPacketWrite(WebSocketBinaryProtocolCodec.java:121)
at com.smartfoxserver.bitswarm.core.BitSwarmEngine.writeToWebSocket(BitSwarmEngine.java:421)
at com.smartfoxserver.bitswarm.core.BitSwarmEngine.write(BitSwarmEngine.java:402)
at com.smartfoxserver.bitswarm.io.Response.write(Response.java:70)
at com.smartfoxserver.v2.api.response.SFSResponseApi.sendExtResponse(SFSResponseApi.java:84)
at com.smartfoxserver.v2.api.SFSApi.sendExtensionResponse(SFSApi.java:1534)
at com.game.main.service.SFSResponseService.sendResponse(SFSResponseService.java:45)
at com.game.main.service.SFSResponseService.sendResponse(SFSResponseService.java:37)
at com.game.main.service.ResponseService.sendResponse(ResponseService.java:24)
at com.game.main.handler.WalkHandler$WalkWorker.run(WalkHandler.java:187)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Last edited by mete2221 on 28 Jan 2020, 17:17, edited 1 time in total.
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SmartFox Server 2X Web Socket Problem

Postby Lapo » 28 Jan 2020, 17:11

Hi,
can you give us an example of a packet that would cause this issue?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
mete2221
Posts: 57
Joined: 30 Aug 2017, 17:01

Re: SmartFox Server 2X Web Socket Problem

Postby mete2221 » 28 Jan 2020, 17:22

Lapo wrote:Hi,
can you give us an example of a packet that would cause this issue?

Thanks


Packet Encoded as Base64

"AIgEd/ugBIV4nK1XyXLiSBCF7o6YvvQc+hN0nT5oo8NyhA/sRm3JrFrqpg0JUwJCLJbU4b+cD5osWgJcsgw45uIyBfUy82Xmy6rvlc+V6up79rda+eJaG+vr3//+ZraL2c6L1h5z+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kTer7nmslfGHcK2rZFLTk4aHtBN/0S3eyV36PutdCA+kRJob84+l6rtuof6S/oKzR1eGldnHkTeo6wyuginXjFi6m7U9dQWaJHTrjh7HstOmhEYf6ZWQzmhbMFuOGkDTJk8B1hG0uRLcig2zF37GeHzi1X0s+lMYD+T21dSyAHPNJrU4uXEkvQ1q6+znucrvFEpbk6V5OQA0PQfrpv47MF/LK5M/bf42ofi6nHb+UjLtyhr9Qph+8soF53dkcKYPacxpFkNva9+vo9Rt/TCzm/eYB7jtMS78i7csfcwpN0RZaXl0o1+lKpfEorVedr5S94t5JnZ6Vqfa58g61P1f8Ac8wIbAA="
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SmartFox Server 2X Web Socket Problem

Postby Lapo » 28 Jan 2020, 18:36

This doesn't look like a valid packet. Either something is missing or it's invalid data.
Can you show us how the Extension is generating/creating the data?
(if you prefer to do it privately send me a private message)

Also, I have tested sending a 330KB image from Extension to client, via the BlueBox, and it did not flinch. I don't think it's a matter of packet size.

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SmartFox Server 2X Web Socket Problem

Postby Lapo » 28 Jan 2020, 18:44

One more thing, if there's a proxy between client and server, like a reverse proxy you might want to double check it's configuration especially in terms of timeouts. If I remember correctly you were using Cloudflare as part of your network setup.
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
mete2221
Posts: 57
Joined: 30 Aug 2017, 17:01

Re: SmartFox Server 2X Web Socket Problem

Postby mete2221 » 28 Jan 2020, 23:18

Lapo wrote:One more thing, if there's a proxy between client and server, like a reverse proxy you might want to double check it's configuration especially in terms of timeouts. If I remember correctly you were using Cloudflare as part of your network setup.


I am not using a proxy. (Like Cloudflare)
I sent a private message.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Stevenor and 67 guests