Class: UDPSocket
- Defined in:
- lib/polyphony/extensions/socket.rb
Overview
UDPSocket extensions
Instance Method Summary collapse
-
#recvfrom(maxlen, flags = 0) ⇒ String
Reimplements #recvfrom.
-
#recvmsg(maxlen = nil, flags = 0, maxcontrollen = nil, opts = {}) ⇒ String
Reimplements #recvmsg.
-
#send(msg, flags, *addr) ⇒ Integer
Sends data.
-
#sendmsg(msg, flags = 0, dest_sockaddr = nil, *controls) ⇒ Integer
Reimplements #sendmsg.
Instance Method Details
#recvfrom(maxlen, flags = 0) ⇒ String
Reimplements #recvfrom.
668 669 670 671 |
# File 'lib/polyphony/extensions/socket.rb', line 668 def recvfrom(maxlen, flags = 0) buf = +'' Polyphony.backend_recvmsg(self, buf, maxlen, 0, flags, 0, nil) end |
#recvmsg(maxlen = nil, flags = 0, maxcontrollen = nil, opts = {}) ⇒ String
Reimplements #recvmsg.
680 681 682 683 |
# File 'lib/polyphony/extensions/socket.rb', line 680 def recvmsg(maxlen = nil, flags = 0, maxcontrollen = nil, opts = {}) buf = +'' Polyphony.backend_recvmsg(self, buf, maxlen || 4096, 0, flags, maxcontrollen, opts) end |
#send(msg, flags, *addr) ⇒ Integer
Sends data.
702 703 704 705 706 707 708 709 710 711 712 713 |
# File 'lib/polyphony/extensions/socket.rb', line 702 def send(msg, flags, *addr) sockaddr = case addr.size when 2 Socket.sockaddr_in(addr[1], addr[0]) when 1 addr[0] else nil end Polyphony.backend_sendmsg(self, msg, flags, sockaddr, nil) end |
#sendmsg(msg, flags = 0, dest_sockaddr = nil, *controls) ⇒ Integer
Reimplements #sendmsg.
692 693 694 |
# File 'lib/polyphony/extensions/socket.rb', line 692 def sendmsg(msg, flags = 0, dest_sockaddr = nil, *controls) Polyphony.backend_sendmsg(self, msg, flags, dest_sockaddr, controls) end |