home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam

Programming Perl


3.2.67 getsockname

getsockname 

SOCKET

This function returns the packed sockaddr address of this end of the SOCKET connection. (And why wouldn't you know your own address already? Because you might have bound an address containing wildcards to the generic socket before doing an accept . Or because you might have been passed a socket by your parent process - for example, inetd .)

use Socket;
$mysockaddr = getsockname(SOCK);
($port, $myaddr) = unpack_sockaddr_in($mysockaddr);

3.2.66 getservent Book Index 3.2.68 getsockopt

[ Library Home | Perl in a Nutshell | Learning Perl | Learning Perl on Win32 | Programming Perl | Advanced Perl Programming | Perl Cookbook ]







(追記) (追記ここまで)


(追記) (追記ここまで)


AltStyle によって変換されたページ (->オリジナル) /