Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!helios.ee.lbl.gov!pasteur!ucbvax!ucdavis!csusac!csuchico.edu!csuchico.edu!warlock From: warlock@csuchico.edu (John Kennedy) Newsgroups: comp.unix.wizards Subject: Local daemon socket Keywords: tcp-ip sockets SOCK_STREAM Message-ID: <1990Mar07.023424.2875@csuchico.edu> Date: 7 Mar 90 02:34:24 GMT Sender: news@csuchico.edu (USENET) Reply-To: warlock@csuchico.edu (John Kennedy) Organization: California State University, Chico Lines: 27 I'm looking for a way to make a daemon executable on more than one machine. Currently I'm using the following code: ..... . servsock = socket( AF_INET, SOCK_STREAM, 0 ); CHECK( servsock, SOCK_FAIL, "socket()" ); server.sin_family = AF_INET; server.sin_addr.s_addr = htonl( INADDR_ANY ); server.sin_port = htons( (u_short) sockaddr ); length = sizeof( struct sockaddr_in ); result = bind( servsock, (struct sockaddr *) &server, length ); servsock = socket( AF_INET, SOCK_STREAM, 0 ); CHECK( result, SOCK_FAIL, "bind()" ); . ..... If I only have one daemon running on the network, it's fine. If I have two or more, they fail to bind the socket (Address already in use). I'd like to limit the daemon so that other daemon's may be run on different host machines. -- Warlock, AKA +---------------------------------------------------- John Kennedy | uucp: lampoon!warlock@csuchico.edu CSCI Student | internet: warlock@csuchico.edu CSU Chico +----------------------------------------------------