Skip to content

Commit 2139cc9

Browse files
committed
Test sending huge datagram fails
1 parent 21ced65 commit 2139cc9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/SocketTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,18 @@ public function testClientSendAfterEndIsNoop(Socket $client)
7575
$this->loop->run();
7676
}
7777

78+
public function testClientSendHugeWillFail()
79+
{
80+
$promise = $this->factory->createClient('127.0.0.1', 12345);
81+
$client = $this->getValueFromResolvedPromise($promise);
82+
83+
$client->send(str_repeat(1, 1024 * 1024));
84+
$client->on('error', $this->expectCallableOnce());
85+
$client->end();
86+
87+
$this->loop->run();
88+
}
89+
7890
public function testCreatePair()
7991
{
8092
$promise = $this->factory->createServer(0, '127.0.0.1');

0 commit comments

Comments
 (0)