Hello!
I need some hints on setting a AF_INET/SOCK_STREAM socket to
non-buffering mode.
After creating and connecting the socket (which seems to succeed,
because no error is reported), I try to send data.
netstat then reports that the data is in the S-Que.
Because I need immediate delivery of every data-set, the buffer should
be flushed every time I do a write.
How can I manage this?
The code I've written looks like this:
...
getting host
getting service
if ((unit = socket(AF_INET, SOCK_STREAM, 0)) < 0)
{
return (E_SOCKET_FAIL);
}
if (connect(unit, (struct sockaddr*) &s, sizeof(s)) < 0)
{
close(unit);
return E_CONNECT_FAILED;
}
-------- the data of the following write is buffered (up to 1024 bytes)
if (write(unit, HELLO_MSG, sizeof(HELLO_MSG)) <0)
{
close(unit);
}
Please give me some hints, I think there should be a ioctl() or
setsockopt() call which will do the job.
Thanks in advance,
Thomas
--
-----------------------------------------------------
THOMAS GEHLER
TH-Darmstadt
FB Flugmechanik & Reglungstechnik
Stick Gruppe (Thurecht)
phone: (+49)6151-16-2290
fax: (+49)6151-16-5434
D-64287 Darmstadt Germany
-----------------------------------------------------