home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!agate!e260-1c.berkeley.edu!c60b-1fk
- From: c60b-1fk@e260-1c.berkeley.edu (Ahmon Dancy)
- Newsgroups: comp.os.linux
- Subject: Unix sockets
- Date: 3 Jan 1993 11:31:57 GMT
- Organization: University of California, Berkeley
- Lines: 35
- Distribution: world
- Message-ID: <1i6irdINNmqu@agate.berkeley.edu>
- NNTP-Posting-Host: e260-1c.berkeley.edu
- Originator: c60b-1fk@e260-1c.berkeley.edu
-
-
- 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)
- -------------------------------------------------------------------------------
-