CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2005
    Posts
    112

    reading data from tcp sockets

    hi

    im working in a C code and unix environment.
    and currently reading up on tcp/ip and socket programming.

    Can anyone recommend good article/section of book specifically dealing with constantly monitoring sockets for data arrival.
    what is best, most efficient approach(s) to consider?
    I guess a basic idea is to start a timer and check the socket for data on every expiration.

    Is there more advanced approaches - like i/o signal or interrupts that I should also consider.

    Pointers appreciated as there is loads of material out there so a short cut would be great.
    thanks.

  2. #2
    Join Date
    Mar 2001
    Posts
    2,529

    Re: reading data from tcp sockets

    If your using UNIX I suggest:

    The Pocket Guide to
    TCP/IP Sockets: C Version

    Michael J. Donahoo
    Kenneth L. Calvert

    Has short concise sections on how to do this.
    http://www.amazon.com/Pocket-Sockets.../dp/1558606866

    Here is the source code:
    http://cs.ecs.baylor.edu/~donahoo/pr.../textcode.html

    A multi-threaded approach will use up less memory than a multi-process fork() loop.
    Last edited by ahoodin; February 2nd, 2009 at 01:05 PM.
    ahoodin
    To keep the plot moving, that's why.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured