Thread: Asynchronous sockets?

  1. #1
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Question Asynchronous sockets?

    I had a question. Can someone let me have an example program using WSAAsyncSelect(...) and things like:


    case FD_READ:
    // code
    break;


    I would like to use it for a program I am making.
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: [email protected]

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    try looking at this
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  3. #3
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Nice tutorial. He glosses over the FW_READ though. Little harder than that in most cases.

    Need to know what type of data and how much you are expecting, before sending the data to be processed.

    ie a chat program.
    If only half the text is recieved in one read what do you do? How do you know you only have half?

    You could send the size of the data first (as a long or int) and read this first, when the actual data starts arriving must wait for all to arrive and then can send it to the screen.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Discerning sockets using asynchronous
    By jmd15 in forum Networking/Device Communication
    Replies: 4
    Last Post: 02-16-2006, 02:03 PM
  2. question about asynchronous sockets
    By pode in forum Networking/Device Communication
    Replies: 8
    Last Post: 12-27-2004, 02:33 PM
  3. Asynchronous sockets
    By dpro in forum Networking/Device Communication
    Replies: 4
    Last Post: 12-20-2004, 06:53 PM
  4. Asynchronous Sockets Class
    By neandrake in forum Networking/Device Communication
    Replies: 0
    Last Post: 11-17-2003, 09:42 AM
  5. Starting window sockets
    By _Cl0wn_ in forum Windows Programming
    Replies: 2
    Last Post: 01-20-2003, 11:49 AM