Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-dev] Sharing/Binding a java.net.Socket among HTTP threads initialized by Jetty server

Hi,

I am developing a simple Jersey + Jetty REST service in which to complete a request, it is needed to send/receive through a java.net.Socket. The socket is initialized during application start-up.

What I'm observing is that although the socket is verified to work as expected in the start-up, during the runtime of the service, trying to complete an arbitrary HTTP request, an exception is thrown which is basically "SocketException: broken pipe". My guess is that most likely the Socket instance is not accessible through different HTTP threads. 

Is this correct? And, what would be the best practice at least from Jetty perspective to have a shared Socket among different HTTP request threads?

Thanks,
Behrooz


Back to the top