You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m trying to develop a multithreaded server which continuously accepts connections and creates a new thread for each client socket. The client socket then receives Java object requests and sends Java object responses (object streaming).
As long as I only have a single connection I.e. one client socket thread and one server thread there is no problem — the client socket remains active responding to message requests— but as soon as I have 2 clients I.e. 2 client socket threads, after serving a few requests (4-5), the client socket hangs while writing out the response object at the ZerotierNative.zts_bsd_write() native call— I traced it to this call in the debugger. Opening another client thread does not help, the new thread also hangs whenever it needs to write out and I have to restart the application.
I wonder if I’m running into some socket related race condition because of not starting/closing a client socket correctly (I looked at the source and can see that there are locks being held and freed for each zts_bsd_write() -> lwip_write() call but could not make much sense of it)…
Looking for some general guidance on multithreading sockets patterns and if I’m overlooking something or if it could be a bug in the library?
This is for a POC at our startup— if it meets our needs we would be looking into a paid engagement.
Hello,
I’m trying to develop a multithreaded server which continuously accepts connections and creates a new thread for each client socket. The client socket then receives Java object requests and sends Java object responses (object streaming).
As long as I only have a single connection I.e. one client socket thread and one server thread there is no problem — the client socket remains active responding to message requests— but as soon as I have 2 clients I.e. 2 client socket threads, after serving a few requests (4-5), the client socket hangs while writing out the response object at the ZerotierNative.zts_bsd_write() native call— I traced it to this call in the debugger. Opening another client thread does not help, the new thread also hangs whenever it needs to write out and I have to restart the application.
I wonder if I’m running into some socket related race condition because of not starting/closing a client socket correctly (I looked at the source and can see that there are locks being held and freed for each zts_bsd_write() -> lwip_write() call but could not make much sense of it)…
Looking for some general guidance on multithreading sockets patterns and if I’m overlooking something or if it could be a bug in the library?
This is for a POC at our startup— if it meets our needs we would be looking into a paid engagement.
Anything looking wrong here?
`
public class Server implements Runnable {
}`
The text was updated successfully, but these errors were encountered: