|
EventBufferEvent::connectConnect 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. パラメータ
戻り値
成功した場合に 例例1 EventBufferEvent::connect example
上の例の出力は、 たとえば以下のようになります。 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 例2 Connect to UNIX domain socket which presumably is served by a server, read response from the server and output it to the console
上の例の出力は、 たとえば以下のようになります。 Received 5 bytes ----- data ---- 5: test 参考
|