Networking Forums

Networking Forums > Computer Networking > Linux Networking > NEED HELP Socket programming : HOW read and write with timeout

Reply
Thread Tools Display Modes

NEED HELP Socket programming : HOW read and write with timeout

 
 
TF
Guest
Posts: n/a

 
      10-13-2005, 08:27 AM
Hello,
I have to do a program (C language) which :

READ socket if nothing to be read then go to
WRITE sochet if nothing to be wrote then go to READ
in a while(1 loop.
Thanks for help


 
Reply With Quote
 
 
 
 
Bit Twister
Guest
Posts: n/a

 
      10-13-2005, 08:43 AM
On Thu, 13 Oct 2005 10:27:05 +0200, TF wrote:
> Hello,
> I have to do a program (C language) which :
>
> READ socket if nothing to be read then go to
> WRITE sochet if nothing to be wrote then go to READ
> in a while(1 loop.



click up a terminal and do a
man 2 read
man 2 write

If you look at the bottom of man pages you might see somethhing like
SEE ALSO
accept(2), bind(2), connect(2), fcntl(2), getpeername(2), getsock-

which indicates you may find more information by doing something like
man 2 connect.

Want to find code examples.

Please bookmark the following, very large,
Frequently Asked Questions (faq) Search engine:

http://groups.google.com/advanced_group_search
key word(s) in the first box
*linux* in Newsgroup box. You need to use the two
asterisks around linux, pick English

If you want/need more control over the first box search,
http://www.google.com/help/refinesearch.html
 
Reply With Quote
 
Tauno Voipio
Guest
Posts: n/a

 
      10-13-2005, 02:12 PM
TF wrote:
> Hello,
> I have to do a program (C language) which :
>
> READ socket if nothing to be read then go to
> WRITE sochet if nothing to be wrote then go to READ
> in a while(1 loop.
> Thanks for help


select() is the tool. man select, or Google.

Next time, please cross-post, if you really need to
post to multiple newsgroups. Now the responses from
different groups are separate, and much of the info
will be duplicated.

--

Tauno Voipio
tauno voipio (at) iki fi


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to write a packet onto the net (or read from the net) with priority Unruh Linux Networking 1 11-07-2007 01:37 AM
VPN & Cable ISP = Slow Read & Write Hareth Windows Networking 1 06-17-2004 05:57 PM
55Mb/sec read but only 1mb/sec write via gigabit =?Utf-8?B?Y2hhcmxpZS1lcA==?= Windows Networking 0 04-15-2004 01:01 AM
read/write permission option John Dodge Windows Networking 1 11-15-2003 04:52 PM
simultaneous read & write on socket fd Dirk Petera Linux Networking 0 09-15-2003 12:52 PM



1 2 3 4 5 6 7 8 9 10 11