From owner-freebsd-questions@FreeBSD.ORG Mon Jun 23 21:27:57 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 46BBD37B401 for ; Mon, 23 Jun 2003 21:27:57 -0700 (PDT) Received: from mta7.pltn13.pbi.net (mta7.pltn13.pbi.net [64.164.98.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 58FA643FBF for ; Mon, 23 Jun 2003 21:27:56 -0700 (PDT) (envelope-from mbsd@pacbell.net) Received: from atlas (adsl-64-165-199-152.dsl.snfc21.pacbell.net [64.165.199.152]) by mta7.pltn13.pbi.net (8.12.9/8.12.3) with ESMTP id h5O4RtMn002895; Mon, 23 Jun 2003 21:27:55 -0700 (PDT) Date: Mon, 23 Jun 2003 21:27:55 -0700 (PDT) From: =?ISO-8859-1?Q?Mikko_Ty=F6l=E4j=E4rvi?= X-X-Sender: mikko@atlas.home To: Gagan Grewal In-Reply-To: <20030623003345.A2921@vsnl.net> Message-ID: <20030623212423.P10158@atlas.home> References: <013a01c33674$8430c200$0eddfea9@perimeter.co.za> <026b01c338ea$f9988190$0a00a8c0@apollo> <20030623003345.A2921@vsnl.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-questions@freebsd.org Subject: Re: using bind() call on FreeBSD X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jun 2003 04:27:57 -0000 On Mon, 23 Jun 2003, Gagan Grewal wrote: > Hi Folks :) > > I am trying to write a simple a server process which follows this sequence... > socket() Assuming a "struct sockaddr_in addr;" around here somewhere, do: memset(&addr, 0, sizeof(addr)); addr.sin_port = htons(blah); etc ... I.e. zero-fill the whole struct before use. $.02, /Mikko > bind() > listen() > accept() > . > . > . > close( descriptor from accept() ) > close( descriptor from socket() ) > > But I am getting error 99 (Cannot assign requested address) from bind(). > > I am trying to bind the socket on 127.0.0.1:3333 > (This works on Linux though) > > Are there any special/extra things I need to do in /etc or elsewhere to make > this program run on FreeBSD ? > > I am running FreeBSD 4.7-RELEASE > > Any help/pointers from you folks would be great :) > > Thanks in advance :) > > Regards, > Gagan. > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" >