swoole-doc icon indicating copy to clipboard operation
swoole-doc copied to clipboard

05 client.php写错了!

Open wanminny opened this issue 8 years ago • 0 comments

client = new swoole_client(SWOOLE_SOCK_TCP); } public function connect() { if( !$this->client->connect("127.0.0.1", 9501 , 1) ) { echo "Error: {$fp->errMsg}[{$fp->errCode}]\n"; } $msg_normal = "This is a Msg"; $msg_eof = "This is a Msg\r\n"; $msg_length = pack("N" , strlen($msg_eof) ). $msg_eof; $i = 0; while( $i client->send( $msg_length ); $i ++; } } } $client = new Client(); $client->connect();

wanminny avatar Apr 01 '16 08:04 wanminny