Re: ext/sockets socket_sendto() 5th param cannot be hostname

From: Date: Sat, 16 Feb 2002 00:20:59 +0000
Subject: Re: ext/sockets socket_sendto() 5th param cannot be hostname
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-80087@lists.php.net to get a copy of this message
Wow thats inconsistent, I will have to fix that. Give me a couple of days to get to it. Thanks, -Jason On Fri, 2002-02-15 at 17:18, Richard Samar wrote: > Hi, > > yeah ext/sockets again :-) > > The 5th param of socket_sendto() obviously cannot be a hostname > (string). socket_bind(), socket_connect() etc. allow this though. > So I am not sure wether it is wanted or not. But I guess it is :-) > > For socket_sendto() though one would need to use > gethostbyname ("my.host.com") and use its returnvalue as the > 5th param to socket_sendto() or directly use a dotted-decimal > notation. > > chaning: > > if (inet_aton(addr, &addr_buf) == 0) { > sin.sin_addr.s_addr = addr_buf.s_addr; > } else { > > > to (omitting "== 0"): > > if (inet_aton(addr, &addr_buf) ) { > sin.sin_addr.s_addr = addr_buf.s_addr; > } else { > > allows to use also hostname. > > I read that inet_aton() returns a pointer to char and not 0 > on success, so that might be the reason why it won't work like > the way it is momently. > > As my karma is insufficent for these parts, maybe someone can make > the mini-fix again :-) ...maybe jason again? ...would be very kind. > > thx and best regards > -moh > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, visit: http://www.php.net/unsub.php > -- Jason T. Greene Internet Software Engineer <jason@inetgurus.net> <jason@php.net> <jason.greene@tdstelecom.com> Use PHP: http://www.php.net

« previous php.dev (#80087) next »