Class: WEBSocket::Socket

Inherits:
Base::Socket
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/WEBSocket/Standard/socket.rb,
lib/WEBSocket/Celluloid/socket.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rhost, rport, lhost = nil, lport = nil) ⇒ Socket

Returns a new instance of Socket.


9
10
11
12
13
# File 'lib/WEBSocket/Standard/socket.rb', line 9

def initialize rhost, rport, lhost = nil, lport = nil
  @status = :disconnected
  @socket = TCPSocket.new rhost, rport, lhost, lport
  connect rhost, rport
end

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status


4
5
6
# File 'lib/WEBSocket/Standard/socket.rb', line 4

def status
  @status
end

Instance Method Details

#acquire_ownership(type) ⇒ Object


9
10
11
# File 'lib/WEBSocket/Celluloid/socket.rb', line 9

def acquire_ownership type
  @socket.acquire_ownership type
end

#evented?Boolean

Returns:

  • (Boolean)

13
14
15
# File 'lib/WEBSocket/Celluloid/socket.rb', line 13

def evented?
  @socket.evented?
end

#release_ownership(type) ⇒ Object


23
24
25
# File 'lib/WEBSocket/Celluloid/socket.rb', line 23

def release_ownership type
  @socket.release_ownership type
end

#wait_readableObject


27
28
29
# File 'lib/WEBSocket/Celluloid/socket.rb', line 27

def wait_readable
  @socket.wait_readable
end

#wait_writableObject


31
32
33
# File 'lib/WEBSocket/Celluloid/socket.rb', line 31

def wait_writable
  @socket.wait_writable
end