Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #33255
| Newsgroups | comp.lang.java.programmer |
|---|---|
| Date | 2015-12-01 09:36 -0800 |
| Message-ID | <cd5afdca-ada8-4c3e-b1da-c29fc8f7442e@googlegroups.com> (permalink) |
| Subject | multithread client socket |
| From | Philipp Kraus <philipp.kraus.flashpixx@gmail.com> |
Hello, I'm using a cached thread pool which gets a lot of callable objects. Each callable create with "new Socket" a client socket to a server, sends data to the server, receive the response and returns the response with a future object. The server closes the socket after the response is send. On large datasets the runtime cannot create new socket objects (socket already in use message). The Java client runs explicit socket.close without any error. My idea is, that each thread of the thread-pool holds a member with the socket, but I need must reconnect the client socket on each task, because the server closes the socket. My question is, how can I use a lot of client sockets which can be closed by the server, but without re instantiation on Java side. On a socket.connect I get "socket is closed" after the server has closed it. Thanks Phil
Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread
multithread client socket Philipp Kraus <philipp.kraus.flashpixx@gmail.com> - 2015-12-01 09:36 -0800
Re: multithread client socket Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2015-12-01 10:12 -0800
Re: multithread client socket Martin Gregorie <martin@address-in-sig.invalid> - 2015-12-01 19:38 +0000
Re: multithread client socket Philipp Kraus <philipp.kraus.flashpixx@gmail.com> - 2015-12-01 22:56 -0800
Re: multithread client socket Martin Gregorie <martin@address-in-sig.invalid> - 2015-12-02 14:57 +0000
Re: multithread client socket Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-12-02 10:54 -0500
Re: multithread client socket Martin Gregorie <martin@address-in-sig.invalid> - 2015-12-02 19:18 +0000
Re: multithread client socket Eric Douglas <e.d.programmer@gmail.com> - 2015-12-02 11:47 -0800
Re: multithread client socket Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-12-02 15:30 -0500
Re: multithread client socket Eric Douglas <e.d.programmer@gmail.com> - 2015-12-02 12:57 -0800
csiph-web