recv issue

This is a discussion on recv issue within the C++ Programming forums, part of the General Programming Boards category; Hi, I've got the connect to server working fine, but the issue is of receive, when I invoke receive the ...

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    10

    Unhappy recv issue

    Hi,
    I've got the connect to server working fine, but the issue is of receive, when I invoke receive the thread hangs!!!
    Please advice..
    Here's the extract of the code
    ===============================
    while ( ii != 0)
    {
    ii = recv(sd,aa,1000,0);
    }
    printf("%d %s",ii,aa);
    }
    ================================

    Any Help would be Appreciated a lot!!!

    Brgds,
    John

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Your code isn't C++, please post on an appropriate board in future.

    Please read this thread regarding code tags.

    In answer to your question, I'd guess its hanging because the socket is blocking (ie waiting for incoming data).

    You can read about socket programming here.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Question about recv
    By carrotcake1029 in forum Networking/Device Communication
    Replies: 2
    Last Post: 02-26-2009, 02:10 PM
  2. float calculation issue
    By George2 in forum C# Programming
    Replies: 1
    Last Post: 05-26-2008, 05:56 AM
  3. recv()
    By afisher in forum Networking/Device Communication
    Replies: 3
    Last Post: 03-24-2004, 05:32 PM
  4. my first issue of GDM
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 09-12-2002, 05:02 PM
  5. non blocking recv
    By rohit in forum Linux Programming
    Replies: 4
    Last Post: 03-05-2002, 09:35 PM

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