A question regarding sockets

For issues with communication ports, protocols, etc.
dani.user
Posts: 284
Joined: Sep 30, 2006 10:41

A question regarding sockets

Postby dani.user » Mar 30, 2007 9:02

Hello

How can I configure a tcp socket so that, when sending data through it, the program should not wait until all the data is received by the other end?

Thank you
maddogg6
Posts: 824
Joined: Dec 07, 2005 22:58
Contact:

Postby maddogg6 » Mar 30, 2007 17:44

use threads??? - I dunno - I dummm.
cha0s
Site Admin
Posts: 5317
Joined: May 27, 2005 6:42
Location: Illinois
Contact:

Postby cha0s » Mar 31, 2007 22:39

Your app sending the information shouldn't halt unless the network becomes overly saturated with the packets you are sending, afaik.
caseih
Posts: 1381
Joined: Feb 26, 2007 5:32

Re: A question regarding sockets

Postby caseih » Apr 04, 2007 3:17

dani.user wrote:Hello

How can I configure a tcp socket so that, when sending data through it, the program should not wait until all the data is received by the other end?

Thank you


Either threaded loops that wait on the socket or asynchronous I/O are the recommended techniques. In Linux, for example, I could use the "select" system call to wait for data on any number of sockets simultaneously and then dispatch to a handling function. Windows has a similar api, called "WaitForMultipleObjects".
dani.user
Posts: 284
Joined: Sep 30, 2006 10:41

Postby dani.user » Apr 05, 2007 19:40

Ok.

Thanks

Return to “Hardware Interfaces / Communication”

Who is online

Users browsing this forum: No registered users and 35 guests