From: c60b-1fk@e260-1c.berkeley.edu (Ahmon Dancy) Subject: Unix sockets Date: 3 Jan 1993 11:31:57 GMT
I've decived to modify LPmud to use Unix sockets rather than inet sockets
because the tcp/ip code does not work reliably enough for me. I'm
having problems getting the unix socket stuff to work though. I've
succeeded in creating, binding, setting up to listen, and setting up
to accept sockets, but calls to connect() always fail for me. Here is
some pseudocode that shows what I do:
server.c
struct sockaddr_un address;
int sock=socket(....)
address.sun_family=AF_INET;
strcpy(address.sun_path, "/pipe");
bind(sock, &address, sizeof(address));
listen(Sock,, 5);
accept...
Running this program will cause a block at accept, which is normal.
client.c
setup sock and address same as above
connect(sock, &address, sizeof(address));
In this program, connect always returns -1. errno seems to be set to
0, also.
Does anyone have any clue about this? Am I doing something wrong? Is
it a problem with linux?
-- =============================================================================== Ahmon Dancy (c60b-1fk@webworm.berkeley.edu) ===============================================================================