using bind() call on FreeBSD
Mikko Työläjärvi
mbsd at pacbell.net
Mon Jun 23 21:27:57 PDT 2003
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 at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
>
More information about the freebsd-questions
mailing list