1--TEST--
2swoole_socket_coro: getpeername
3--SKIPIF--
4<?php require __DIR__ . '/../include/skipif.inc'; ?>
5--FILE--
6<?php
7require __DIR__ . '/../include/bootstrap.php';
8
9use Swoole\Coroutine\System;
10
11Co\run(
12    function () {
13        $conn = new Swoole\Coroutine\Socket(AF_INET, SOCK_STREAM, IPPROTO_IP);
14        $conn->connect('www.baidu.com', 80);
15        $info = $conn->getpeername();
16        Assert::eq($info['address'], System::gethostbyname('www.baidu.com'));
17        Assert::eq($info['port'], 80);
18    }
19);
20?>
21--EXPECT--
22