update : 2015.11.03
php.shukuma.com검색:
|
EventBufferEvent::connect(PECL event >= 1.2.6-beta) EventBufferEvent::connect — Connect buffer event's file descriptor to given address or UNIX socket 설명
public
bool
EventBufferEvent::connect
(
string
$addr
)Connect buffer event's file descriptor to given address(optionally with port), or a UNIX domain socket. If socket is not assigned to the buffer event, this function allocates a new socket and makes it non-blocking internally. To resolve DNS names(asyncronously), use EventBufferEvent::connectHost() method. 인수
반환값
Returns 예제Example #1 EventBufferEvent::connect() example
<?php 위 예제의 출력 예시: step 1 step 2 step 3 Connected. HTTP/1.1 200 OK Server: nginx/1.2.6 Date: Sat, 09 Mar 2013 10:06:58 GMT Content-Type: text/html; charset=utf-8 Connection: close X-Powered-By: PHP/5.4.11--pl2-gentoo sdfsdfsf Closing Done Example #2 Connect to UNIX domain socket which presumably is served by a server, read response from the server and output it to the console
<?php 위 예제의 출력 예시: Received 5 bytes ----- data ---- 5: test 참고
|