From professional translators, enterprises, web pages and freely available translation repositories.
예 2. udp 연결을 사용합니다
?php $fp = fsockopen( "udp: / /127.0.0.1", 13, $errno, $errstr); if (!$fp) {echo "error: $errno - $errstr br \n";} else {fwrite($fp ,"\n"); echo fread($fp, 26); fclose($fp);}?
참고: 시간초과 매개변수는 php 3.0.9 에 소개가 되었고 udp 지원은 php 4에 추가되었습니다.
the reason for this is because udp is a "connectionless" protocol, which means that the operating system does not try to establish a link for the socket until it actually needs to send or receive data.
getservbyname() 은 /etc/services 에 정의된 protocol 의 service 에 대응이 되는 인터넷 포트를 반환합니다. protocol 은 tcp 이거나 udp 입니다.
getservbyname() returns the internet port which corresponds to service for the specified protocol as per / etc / services. protocol is either "tcp "or "udp" (in lowercase).