Class: WebSocketClient::SocketByteSource

Inherits:
ByteSource
  • Object
show all
Defined in:
lib/websocket_client/byte_source.rb

Instance Method Summary collapse

Methods inherited from ByteSource

#getbytes

Constructor Details

#initialize(socket) ⇒ SocketByteSource

Returns a new instance of SocketByteSource.



62
63
64
65
66
67
68
69
# File 'lib/websocket_client/byte_source.rb', line 62

def initialize(socket)
  @socket = socket
  if ( socket.respond_to? :getbyte )
    alias :getbyte :getbyte_19
  else
    alias :getbyte :getbyte_18
  end
end

Instance Method Details

#eof?Boolean

Returns:

  • (Boolean)


79
80
81
# File 'lib/websocket_client/byte_source.rb', line 79

def eof?
  @socket.eof?
end

#getbyte_18Object



71
72
73
# File 'lib/websocket_client/byte_source.rb', line 71

def getbyte_18
  @socket.getc
end

#getbyte_19Object



75
76
77
# File 'lib/websocket_client/byte_source.rb', line 75

def getbyte_19
  @socket.getbyte
end