non-blocking connect in C?

Discussion in 'C Programming' started by Trishia Rose, Jul 11, 2003.

  1. Trishia Rose

    Trishia Rose Guest

    Hi,

    I understand how to operate non-blocking send and recv in C, so
    as to exchange data with multiple connections without blocking with
    every function call. My question is, how to set up a non-blocking
    call to the connect function, so that it will just run the call and
    immediately go on with whatever line is next in the code (even though
    it might not have had time to finish establishing a connection), and
    then the socket can somehow (how?) be checked later to see when/if the
    connection finishes being established. This would probably involve
    polling with the select function, I assume? Thanks very much in
    advance! (I use GCC on a win XP machine) And P.S., this is not homework
     
    Trishia Rose, Jul 11, 2003
    #1
    1. Advertising

  2. On 11 Jul 2003 00:56:56 -0700, in comp.lang.c ,
    (Trishia Rose) wrote:

    >Hi,
    >
    > I understand how to operate non-blocking send and recv in C, so
    >as to exchange data with multiple connections without blocking with
    >every function call. My question is, how to set up a non-blocking
    >call to the connect function,


    unfortunately connect(), recv() and send() are not part of C.

    You need to ask this question in a unix programming group, since
    networking is typically topical there (don't worry that you're using
    XP, the TCP/IP networking is essentially common).


    --
    Mark McIntyre
    CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
    CLC readme: <http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>


    ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
    http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
    ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
     
    Mark McIntyre, Jul 11, 2003
    #2
    1. Advertising

  3. Trishia Rose

    Jason Guest

    Look up fcntl and SO_NONBLOCK in your manual.
     
    Jason, Jul 11, 2003
    #3
  4. Trishia Rose

    dbtid Guest

    [OT] Re: non-blocking connect in C?

    Jason wrote:
    > Look up fcntl and SO_NONBLOCK in your manual.
    >
    >


    Actually, ITYM O_NONBLOCK.
     
    dbtid, Jul 11, 2003
    #4
    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. Hendra Gunawan
    Replies:
    1
    Views:
    13,061
    Allan Herriman
    Apr 8, 2004
  2. Andre Kelmanson

    blocking i/o vs. non blocking i/o (performance)

    Andre Kelmanson, Oct 10, 2003, in forum: C Programming
    Replies:
    3
    Views:
    996
    Valentin Tihomirov
    Oct 12, 2003
  3. nukleus
    Replies:
    14
    Views:
    909
    Chris Uppal
    Jan 22, 2007
  4. Christian
    Replies:
    5
    Views:
    759
    Esmond Pitt
    Dec 2, 2007
  5. Serge Savoie
    Replies:
    4
    Views:
    291
    Serge Savoie
    Oct 1, 2008
Loading...

Share This Page