Class: IPSocket
- Inherits:
-
BasicSocket
- Object
- IO
- BasicSocket
- IPSocket
- Defined in:
- ext/enterprise_script_service/mruby/mrbgems/mruby-socket/mrblib/socket.rb
Constant Summary
Constants inherited from IO
IO::BUF_SIZE, IO::SEEK_CUR, IO::SEEK_END, IO::SEEK_SET
Instance Attribute Summary
Attributes inherited from BasicSocket
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from BasicSocket
do_not_reverse_lookup, do_not_reverse_lookup=, for_fd, #initialize, #local_address, #recv_nonblock, #remote_address
Methods inherited from IO
#<<, #_read_buf, #each, #each_byte, #eof?, #flush, #getc, #gets, #hash, open, pipe, popen, #pos, #pos=, #print, #printf, #puts, read, #read, #readchar, #readline, #readlines, #rewind, #seek, #ungetc, #write
Constructor Details
This class inherits a constructor from BasicSocket
Class Method Details
.getaddress(host) ⇒ Object
212 213 214 |
# File 'ext/enterprise_script_service/mruby/mrbgems/mruby-socket/mrblib/socket.rb', line 212 def self.getaddress(host) Addrinfo.ip(host).ip_address end |
Instance Method Details
#addr ⇒ Object
216 217 218 |
# File 'ext/enterprise_script_service/mruby/mrbgems/mruby-socket/mrblib/socket.rb', line 216 def addr Addrinfo.new(self.getsockname)._to_array end |
#peeraddr ⇒ Object
220 221 222 |
# File 'ext/enterprise_script_service/mruby/mrbgems/mruby-socket/mrblib/socket.rb', line 220 def peeraddr Addrinfo.new(self.getpeername)._to_array end |
#recvfrom(maxlen, flags = 0) ⇒ Object
224 225 226 227 |
# File 'ext/enterprise_script_service/mruby/mrbgems/mruby-socket/mrblib/socket.rb', line 224 def recvfrom(maxlen, flags=0) msg, sa = _recvfrom(maxlen, flags) [ msg, Addrinfo.new(sa)._to_array ] end |