Xref: utzoo alt.sys.sun:4041 comp.unix.wizards:25788 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!mintaka!bloom-picayune.mit.edu!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: alt.sys.sun,comp.unix.wizards,comp.unix.programer Subject: Re: Maybe I am missing something....but why doesn't this work? Keywords: TCP SOCKETS Message-ID: <1991May30.031507.13577@athena.mit.edu> Date: 30 May 91 03:15:07 GMT References: <1991May29.145535.23801@bradley.bradley.edu> Sender: news@athena.mit.edu (News system) Followup-To: comp.unix.programmer Organization: Massachusetts Institute of Technology Lines: 14 You need to bzero the sockaddr_in structure (backupserver) before putting anything into it. I compiled your program as-is (with a different host name) and it didn't work. I then added the line "bzero((char *) &backupserver, sizeof(backupserver));" right before "backupserver.sin_family = AF_INET;" and it worked fine. -- Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8085 Home: 617-782-0710