Simple NIO sockets example.

Discussion in 'Java' started by dp, Jun 2, 2005.

  1. dp

    dp Guest

    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?
    dp, Jun 2, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. HDSkiFreak
    Replies:
    2
    Views:
    3,538
    HDSkiFreak
    May 11, 2004
  2. iksrazal

    NIO with timeouts != NIO?

    iksrazal, Jun 17, 2004, in forum: Java
    Replies:
    1
    Views:
    6,255
    iksrazal
    Jun 18, 2004
  3. Kam
    Replies:
    0
    Views:
    708
  4. Chris Berg
    Replies:
    3
    Views:
    5,549
    Gordon Beaton
    Feb 25, 2005
  5. Ishwar Rattan

    timeout and sockets example request??

    Ishwar Rattan, Jul 22, 2004, in forum: Python
    Replies:
    3
    Views:
    3,495
    Dave Brueck
    Jul 23, 2004
Loading...

Share This Page