class UNIXSocket

Public Instance Methods

<<(mesg) click to toggle source
# File lib/polyphony/extensions/socket.rb, line 298
def <<(mesg)
  Polyphony.backend_send(self, mesg, 0)
end
feed_loop(receiver, method = :call, &block) click to toggle source
# File lib/polyphony/extensions/socket.rb, line 286
def feed_loop(receiver, method = :call, &block)
  Polyphony.backend_recv_feed_loop(self, receiver, method, &block)
end
orig_read(maxlen = nil, buf = nil, buf_pos = 0)
Alias for: read
read(maxlen = nil, buf = nil, buf_pos = 0) click to toggle source
# File lib/polyphony/extensions/socket.rb, line 261
def read(maxlen = nil, buf = nil, buf_pos = 0)
  return Polyphony.backend_recv(self, buf, maxlen, buf_pos) if buf
  return Polyphony.backend_recv(self, buf || +'', maxlen, 0) if maxlen
  
  buf = +''
  len = buf.bytesize
  while true
    Polyphony.backend_recv(self, buf, maxlen || 4096, -1)
    new_len = buf.bytesize
    break if new_len == len

    len = new_len
  end
  buf
end
Also aliased as: orig_read
read_loop(maxlen = 8192, &block)
Alias for: recv_loop
read_nonblock(len, str = nil, exception: true) click to toggle source
# File lib/polyphony/extensions/socket.rb, line 308
def read_nonblock(len, str = nil, exception: true)
  @io.read_nonblock(len, str, exception: exception)
end
readpartial(maxlen, str = +'', buffer_pos = 0, raise_on_eof = true) click to toggle source
# File lib/polyphony/extensions/socket.rb, line 302
def readpartial(maxlen, str = +'', buffer_pos = 0, raise_on_eof = true)
  result = Polyphony.backend_recv(self, str, maxlen, buffer_pos)
  raise EOFError if !result && raise_on_eof
  result
end
recv(maxlen, flags = 0, outbuf = nil) click to toggle source
# File lib/polyphony/extensions/socket.rb, line 277
def recv(maxlen, flags = 0, outbuf = nil)
  Polyphony.backend_recv(self, outbuf || +'', maxlen, 0)
end
recv_loop(maxlen = 8192, &block) click to toggle source
# File lib/polyphony/extensions/socket.rb, line 281
def recv_loop(maxlen = 8192, &block)
  Polyphony.backend_recv_loop(self, maxlen, &block)
end
Also aliased as: read_loop
send(mesg, flags) click to toggle source
# File lib/polyphony/extensions/socket.rb, line 290
def send(mesg, flags)
  Polyphony.backend_send(self, mesg, flags)
end
write(*args) click to toggle source
# File lib/polyphony/extensions/socket.rb, line 294
def write(*args)
  Polyphony.backend_sendv(self, args, 0)
end
write_nonblock(buf, exception: true) click to toggle source
# File lib/polyphony/extensions/socket.rb, line 312
def write_nonblock(buf, exception: true)
  @io.write_nonblock(buf, exception: exception)
end