Method: UDPSocket#bind
- Defined in:
- udpsocket.c
#bind(host, port) ⇒ Object
127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'udpsocket.c', line 127
static VALUE
udp_bind(VALUE self, VALUE host, VALUE port)
{
struct udp_arg arg = {.io = self};
arg.res = rsock_addrinfo(host, port, rsock_fd_family(rb_io_descriptor(self)), SOCK_DGRAM, 0);
VALUE result = rb_ensure(udp_bind_internal, (VALUE)&arg, rsock_freeaddrinfo, (VALUE)arg.res);
if (!result) {
rsock_sys_fail_host_port("bind(2)", host, port);
}
return INT2FIX(0);
}
|