summaryrefslogtreecommitdiff
path: root/t/64handle-bind.t
diff options
context:
space:
mode:
Diffstat (limited to 't/64handle-bind.t')
-rw-r--r--t/64handle-bind.t36
1 files changed, 36 insertions, 0 deletions
diff --git a/t/64handle-bind.t b/t/64handle-bind.t
new file mode 100644
index 0000000..772f9e6
--- /dev/null
+++ b/t/64handle-bind.t
@@ -0,0 +1,36 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use IO::Async::Test;
+
+use Test::More;
+
+use IO::Async::Loop;
+
+use IO::Async::Handle;
+
+my $loop = IO::Async::Loop->new_builtin;
+
+testing_loop( $loop );
+
+# ->bind a UDP service
+{
+ my $recv_count;
+
+ my $receiver = IO::Async::Handle->new(
+ on_read_ready => sub { $recv_count++ },
+ on_write_ready => sub { },
+ );
+ $loop->add( $receiver );
+
+ $receiver->bind(
+ service => "0",
+ socktype => "dgram",
+ )->get;
+
+ ok( $receiver->read_handle->sockport, '$receiver bound to a read handle' );
+}
+
+done_testing;