Simple Question recv

This is a discussion on Simple Question recv within the Networking/Device Communication forums, part of the General Programming Boards category; ok im new to sockets in c++ (i started learning a few hours ago) i used em before in a ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,494
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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, 08:46 AM
  4. simple question.
    By InvariantLoop in forum Windows Programming
    Replies: 4
    Last Post: 01-31-2005, 11:15 AM
  5. simple fgets question
    By theweirdo in forum C Programming
    Replies: 7
    Last Post: 01-27-2002, 05:58 PM

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