Thread: Simple Question recv

  1. #1
    Registered User MicroFiend's Avatar
    Join Date
    Nov 2002
    Posts
    80

    Question Simple Question recv

    ok im new to sockets in c++ (i started learning a few hours ago) i used em before in a nice and simple ocx back when i coded in vb, but im having 1 major problem im calling recv() to get any data but if i call it and thr is no data it hangs, is thr a method of checking see if thr is a msg before i use recv() or is thr a flag like no_wait, any help would be great i think i may have to use select, or WSAAsyncSelect and if so could u post an example or if not post the better way lol cheers thanx
    You can stop change as easily as u can drink the sea with a fork

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Your approach is correct
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Check out MSDN.

    http://msdn.microsoft.com/library/de.../ntwrkprot.asp

    Check out my website for software development links.

    http://www.dslextreme.com/users/kuphryn/links.html

    I highly recommend Network Programming for Microsoft Windows, Second Edition by Anthony Jones and Jim Ohmund.

    Kuphryn

  4. #4
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768
    if you want to use select i think you better read Beej’s Guide to Network Programming . it will give you all the examples you need.
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

  5. #5
    Registered User MicroFiend's Avatar
    Join Date
    Nov 2002
    Posts
    80
    actualy salems post was all i needed but thanx for the followup, im using WSAAsyncSelect() sending my msg handle'r window handle, WM_NET (defined) and sending the flags for return on recv msg, then im checking in the window proc for the msg then im checking the socket using recv, but thanx neways
    You can stop change as easily as u can drink the sea with a fork

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple question regarding variables
    By Flakster in forum C++ Programming
    Replies: 10
    Last Post: 05-18-2005, 08:10 PM
  2. Simple class question
    By 99atlantic in forum C++ Programming
    Replies: 6
    Last Post: 04-20-2005, 11:41 PM
  3. Simple question about pausing program
    By Noid in forum C Programming
    Replies: 14
    Last Post: 04-02-2005, 09:46 AM
  4. simple question.
    By InvariantLoop in forum Windows Programming
    Replies: 4
    Last Post: 01-31-2005, 12:15 PM
  5. simple fgets question
    By theweirdo in forum C Programming
    Replies: 7
    Last Post: 01-27-2002, 06:58 PM