Class: RBGL::GUI::X11::Transport

Inherits:
Object
  • Object
show all
Defined in:
lib/rbgl/gui/x11/transport.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(socket) ⇒ Transport

Returns a new instance of Transport.



9
10
11
# File 'lib/rbgl/gui/x11/transport.rb', line 9

def initialize(socket)
  @socket = socket
end

Instance Attribute Details

#socketObject (readonly)

Returns the value of attribute socket.



7
8
9
# File 'lib/rbgl/gui/x11/transport.rb', line 7

def socket
  @socket
end

Instance Method Details

#flushObject



21
22
23
# File 'lib/rbgl/gui/x11/transport.rb', line 21

def flush
  @socket.flush
end

#pendingObject



25
26
27
# File 'lib/rbgl/gui/x11/transport.rb', line 25

def pending
  IO.select([@socket], nil, nil, 0) ? 1 : 0
end

#read(length) ⇒ Object



17
18
19
# File 'lib/rbgl/gui/x11/transport.rb', line 17

def read(length)
  @socket.read(length)
end

#write(data) ⇒ Object



13
14
15
# File 'lib/rbgl/gui/x11/transport.rb', line 13

def write(data)
  @socket.write(data)
end