home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / linux / 22532 < prev    next >
Encoding:
Text File  |  1993-01-03  |  1.5 KB  |  48 lines

  1. Path: sparky!uunet!spool.mu.edu!agate!e260-1c.berkeley.edu!c60b-1fk
  2. From: c60b-1fk@e260-1c.berkeley.edu (Ahmon Dancy)
  3. Newsgroups: comp.os.linux
  4. Subject: Unix sockets
  5. Date: 3 Jan 1993 11:31:57 GMT
  6. Organization: University of California, Berkeley
  7. Lines: 35
  8. Distribution: world
  9. Message-ID: <1i6irdINNmqu@agate.berkeley.edu>
  10. NNTP-Posting-Host: e260-1c.berkeley.edu
  11. Originator: c60b-1fk@e260-1c.berkeley.edu
  12.  
  13.  
  14. I've decived to modify LPmud to use Unix sockets rather than inet sockets
  15. because the tcp/ip code does not work reliably enough for me.  I'm 
  16. having problems getting the unix socket stuff to work though.  I've
  17. succeeded in creating, binding, setting up to listen, and setting up
  18. to accept sockets, but calls to connect() always fail for me.  Here is
  19. some pseudocode that shows what I do:
  20.  
  21. server.c
  22.  
  23. struct sockaddr_un address;
  24. int sock=socket(....)
  25. address.sun_family=AF_INET;
  26. strcpy(address.sun_path, "/pipe");
  27. bind(sock, &address, sizeof(address));
  28. listen(Sock,, 5); 
  29. accept...
  30.  
  31.  
  32. Running this program will cause a block at accept, which is normal.
  33.  
  34. client.c
  35.  
  36. setup sock and address same as above
  37. connect(sock, &address, sizeof(address));
  38.  
  39. In this program, connect always returns -1.  errno seems to be set to
  40. 0, also.  
  41.  
  42. Does anyone have any clue about this?  Am I doing something wrong? Is
  43. it a problem with linux?
  44. -- 
  45. -------------------------------------------------------------------------------
  46. Ahmon Dancy  (c60b-1fk@webworm.berkeley.edu)
  47. -------------------------------------------------------------------------------
  48.