PHP » GoLang |
login |
register |
about
|
GoLang EventBufferEvent::connect
request it (380)
GoLang replacement for PHP's EventBufferEvent::connect
[edit | history]
EventBufferEvent::connect(PECL event >= 1.2.6-beta) EventBufferEvent::connect — Connect buffer event's file descriptor to given address or UNIX socket Description
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. Parameters
Return Values
Returns ExamplesExample #1 EventBufferEvent::connect() example
<?php The above example will output something similar to: 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 The above example will output something similar to: Received 5 bytes ----- data ---- 5: test See Also
|
more
Recently updated
more
Most requested
more
Last requests
|