Simple NIO sockets example.

D

dp

I want to be able to send a HTTP-post to a server, not knowing if it's
online or not. This needs to be done frequently, and in multiple
concurrent threads (centralized message logging).

I've tried URLConnection and Sockets, both of them lock the thread
while tying to connect to the server. I havn't found any timeout
settings for the connect, only for established connections. I'd like to
keep resouces used to a minium and avoid creating additional time-out
threads.
From what I've read, NIO sockets seems to be the way to go. I haven't
found much info on this subject though. Could someone please help me
with a simple NIO socket example of a HTTP POST command with a connect
timeout?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,477
Members
44,898
Latest member
BlairH7607

Latest Threads

Top