tlf30 / monkey-netty

A implementation of a server-client communication system for jMonkeyEngine using Netty.IO that utilizes both TCP and UDP communication.
MIT License
12 stars 5 forks source link

Issue: Connection Timeout do not await when connection server is not running. #10

Closed oxplay2 closed 3 years ago

oxplay2 commented 3 years ago

As discussed, looks like we have issue with method:

cfg.setConnectTimeoutMillis();

that do not await when trying to connect to "offline" server

tlf30 commented 3 years ago

This looks relevant: https://stackoverflow.com/questions/46614123/netty-client-takes-very-long-before-broken-network-is-detected

oxplay2 commented 3 years ago

Hmm... but i suppose it refer only when server have connection with client?

while here we have a lot exceptions in 1 second, just because it loop connection try while server is "off"

tlf30 commented 3 years ago

Yes, I will work on something a little cleaner than the attached stackoverflow solution. I am thinking like a custom timeout handler with our own heartbeat from the server periodically, perhaps the heartbeat period can be configurable.

oxplay2 commented 3 years ago

im not sure if we think about same issue. (or maybe i just dont understand hearbeat solution)

oxplay2 commented 3 years ago

i think the only change here needed would be "custom timeout" but only for "reconnect" functionality, the other should use Netty default method.

tlf30 commented 3 years ago

Tagging internal issue: https://git.liquidcrystalstudios.com/outside/outside/-/issues/201