Asynchronous sockets?

This is a discussion on Asynchronous sockets? within the Windows Programming forums, part of the Platform Specific Boards category; I had a question. Can someone let me have an example program using WSAAsyncSelect(...) and things like: case FD_READ: // ...

  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: trifaze_mattu@lycos.com

    ---------------------------------
    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,856
    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, 01:03 PM
  2. question about asynchronous sockets
    By pode in forum Networking/Device Communication
    Replies: 8
    Last Post: 12-27-2004, 01:33 PM
  3. Asynchronous sockets
    By dpro in forum Networking/Device Communication
    Replies: 4
    Last Post: 12-20-2004, 05:53 PM
  4. Asynchronous Sockets Class
    By neandrake in forum Networking/Device Communication
    Replies: 0
    Last Post: 11-17-2003, 08:42 AM
  5. Starting window sockets
    By _Cl0wn_ in forum Windows Programming
    Replies: 2
    Last Post: 01-20-2003, 10:49 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21