winsock message constants

This is a discussion on winsock message constants within the Windows Programming forums, part of the Platform Specific Boards category; heylo well i've got winsock working, but i cant find the constants for when winsock is receiving data or theres ...

  1. #1
    i want wookie cookies the Wookie's Avatar
    Join Date
    Oct 2002
    Posts
    455

    winsock message constants

    heylo

    well i've got winsock working, but i cant find the constants for when winsock is receiving data or theres a connection attempt etc...like the constants for the callback function, like WM_COMMAND etc

    any ideas? i've looked around for the last hour or so couldnt find anything

    thanks


    oh and another question - doyou have to manually program a chat server app for multiple clients? how would you do that? multithreading?
    Last edited by the Wookie; 11-07-2002 at 02:14 PM.

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    What I/O model do you use?

    Kuphryn

  3. #3
    i want wookie cookies the Wookie's Avatar
    Join Date
    Oct 2002
    Posts
    455
    what do you mean? its a windowed app, not a console

    its like


    switch(wMsg){
    case WM_COMMAND:
    break;
    }

    etc etc
    Last edited by the Wookie; 11-08-2002 at 11:23 AM.

  4. #4
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    what are you looking for? FD_READ, FD_CONNECT, FD_CLOSE, etc...?
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  5. #5
    i want wookie cookies the Wookie's Avatar
    Join Date
    Oct 2002
    Posts
    455
    Oh, I think that's what I'm asking for. I'm looking for the constants that say when theres a pending connection/data arrival etc

  6. #6
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    well that's them. FD_READ tells you there's something to be read. etc... But I believe you have to be on an "asynchronous" socket to get them. WSAAsyncSelect will assign an asynchronous socket to a window.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  7. #7
    i want wookie cookies the Wookie's Avatar
    Join Date
    Oct 2002
    Posts
    455
    How do you do that? Just use WSAASyncSelect() or something like that? And it'll automatically fwd it to my window proc right?

    I'm really new to API programming (used to use MFC, didn't like it)

  8. #8
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    oh man, it's been a year or so since I looked at this but I'll remember some. You will need a lib, wsock32.lib. The include is winsock.h of course. Here's some msdn sites that may help:

    http://msdn.microsoft.com/library/de...asp?frame=true

    http://msdn.microsoft.com/library/de...ncselect_2.asp
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  9. #9
    i want wookie cookies the Wookie's Avatar
    Join Date
    Oct 2002
    Posts
    455
    So I'd use the int WSAASycSelect() the same way as the callback?

    Thanks alot dude

  10. #10
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    no, WSAAsyncSelect just takes a socket, assigns a window to it, assignes a series of FD_* messages to handle and makes it so that your socket sends those messages to a given window. Your callback for the window will do the work.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  11. #11
    i want wookie cookies the Wookie's Avatar
    Join Date
    Oct 2002
    Posts
    455
    ooo ok, gotcha. Thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Strange string behavior
    By jcafaro10 in forum C Programming
    Replies: 2
    Last Post: 04-07-2009, 07:38 PM
  2. Message class ** Need help befor 12am tonight**
    By TransformedBG in forum C++ Programming
    Replies: 1
    Last Post: 11-29-2006, 10:03 PM
  3. Making a script language?
    By Blackroot in forum Game Programming
    Replies: 10
    Last Post: 02-16-2006, 01:22 AM
  4. Dialog Box Problems
    By Morgul in forum Windows Programming
    Replies: 21
    Last Post: 05-31-2005, 05:48 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM

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