|
Home > Archive > Unix Programming > June 2005 > AF_LOCAL, SOCK_STREAM, and buffering
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
AF_LOCAL, SOCK_STREAM, and buffering
|
|
| Dan Ponte 2005-06-25, 8:47 pm |
| Hi all.
I'm writing an application that has a server and a client. Both
use Unix domain sockets.
One of the functions of the server is, in a certain mode, to
copy from a socket to the modem, byte-for-byte.
Now, the client reads every line and sends it along the socket.
However, the server doesn't receive any data until the connection closes
(close(2), interrupt of the client, etc). This seems somewhat strange,
as sockets wouldn't seem like a primg target for Nagle, and attempting
to set TCP_NODELAY results in an "operation not supported" error.
I would use SOCK_DGRAM, but I need the connection-oriented
property of SOCK_STREAM. This is under FreeBSD.
Any ideas?
-Dan
--
Dan Ponte
9:16PM up 17 days, 23 hrs, 5 users, load averages: 0.03, 0.02, 0.00
| |
| Barry Margolin 2005-06-25, 8:47 pm |
| In article <ypnve.37687$rb6.12703@lakeread07>,
Dan Ponte <dcp1990@neptune.atopia.net> wrote:
> Hi all.
> I'm writing an application that has a server and a client. Both
> use Unix domain sockets.
> One of the functions of the server is, in a certain mode, to
> copy from a socket to the modem, byte-for-byte.
> Now, the client reads every line and sends it along the socket.
> However, the server doesn't receive any data until the connection closes
> (close(2), interrupt of the client, etc). This seems somewhat strange,
> as sockets wouldn't seem like a primg target for Nagle, and attempting
> to set TCP_NODELAY results in an "operation not supported" error.
Something's wrong with your code. Can you post it?
> I would use SOCK_DGRAM, but I need the connection-oriented
> property of SOCK_STREAM. This is under FreeBSD.
> Any ideas?
> -Dan
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
| |
| Dan Ponte 2005-06-26, 2:48 am |
| And then, Barry Margolin <barmar@alum.mit.edu> inputted into his terminal:
> In article <ypnve.37687$rb6.12703@lakeread07>,
> Dan Ponte <dcp1990@neptune.atopia.net> wrote:
>
>
> Something's wrong with your code. Can you post it?
>
>
The server code of interest is at ftp://styx.theamigan.net/cb.txt and
the client code is at ftp://styx.theamigan.net/phonectl.c.
-Dan
--
Dan Ponte
10:23PM up 18 days, 7 mins, 5 users, load averages: 0.00, 0.00, 0.00
| |
| Dan Ponte 2005-06-26, 2:48 am |
| And then, Dan Ponte <dcp1990@neptune.atopia.net> inputted into his terminal:
> And then, Barry Margolin <barmar@alum.mit.edu> inputted into his terminal:
> The server code of interest is at ftp://styx.theamigan.net/cb.txt and
> the client code is at ftp://styx.theamigan.net/phonectl.c.
> -Dan
Boy, do I feel stupid. In phonectl.c, you will notice a recv() right
after the send() inside the interactive loop. Turns out the client was
waiting for acknowledgement back from the server (which never happened,
due to a fault of nobody but myself). The recv() would block.
Sorry for wasting everyone's time. Now, to figure out how to get the
damned modem working with this kludge. :-)
-Dan
--
Dan Ponte
10:42PM up 18 days, 26 mins, 5 users, load averages: 0.22, 0.17, 0.07
|
|
|
|
|