Class: IOOTCPSocket

Inherits:
TCPSocket show all
Includes:
ImplIOO
Defined in:
lib/ioo.rb

Instance Method Summary collapse

Methods included from ImplIOO

#<<, #each, #each_byte, #getc, #gets, #print, #printf, #putc, #puts, #readchar, #readline, #readlines

Instance Method Details

#read(integer = nil, buffer = '') ⇒ Object

Raises:

  • (ArgumentError)


143
144
145
146
147
148
149
# File 'lib/ioo.rb', line 143

def read ( integer=nil, buffer='' )
  raise ArgumentError unless buffer.is_a? String
  raise NotImplementedError if integer.nil?
  raise ArgumentError unless integer.is_a? Numeric
  buffer += real_recv(integer, 0)
  return buffer
end

#recv(integer, flags = nil) ⇒ Object



139
140
141
# File 'lib/ioo.rb', line 139

def recv ( integer, flags=nil )
  read(integer)
end

#send(obj, flags = nil) ⇒ Object



151
152
153
# File 'lib/ioo.rb', line 151

def send ( obj, flags=nil )
  write(obj)
end

#write(obj) ⇒ Object



155
156
157
158
# File 'lib/ioo.rb', line 155

def write ( obj )
  real_send(obj.to_s, 0)
  nil
end