Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix plan and add some missing code to 03-socket.t

  • Loading branch information...
commit f0dc057e1745c358e77c8142ce84c09bb54695d9 1 parent b85969e
@tadzik authored
Showing with 17 additions and 3 deletions.
  1. +17 −3 t/03-socket.t
View
20 t/03-socket.t
@@ -1,6 +1,6 @@
use Test;
use MuEvent;
-plan 12;
+plan 13;
my $l = IO::Socket::INET.new(
:localhost('localhost'),
@@ -21,10 +21,10 @@ sub socket-cb(:$sock) {
cb => sub (:$sock) {
my $a = $sock.recv;
if $a {
- is $a, $last-sent-message;
+ is $a, $last-sent-message, 'data received';
return True;
} else {
- ok 'disconnected';
+ pass 'disconnected';
$sock.close;
return False;
}
@@ -37,6 +37,20 @@ sub socket-cb(:$sock) {
my $c1 = IO::Socket::INET.new(:host('localhost'), :port(6666));
my $c2 = IO::Socket::INET.new(:host('localhost'), :port(6666));
+MuEvent::socket(
+ socket => $l,
+ poll => 'r',
+ cb => &socket-cb,
+ params => { sock => $l },
+);
+
+MuEvent::socket(
+ socket => $l,
+ poll => 'r',
+ cb => &socket-cb,
+ params => { sock => $l },
+);
+
MuEvent::timer(
after => 2,
cb => sub {
Please sign in to comment.
Something went wrong with that request. Please try again.