Class: Sappho::Socket::ConnectedSocket
- Inherits:
-
Object
- Object
- Sappho::Socket::ConnectedSocket
- Defined in:
- lib/sappho-socket/connected_socket.rb
Instance Method Summary collapse
- #attach(socket) ⇒ Object
- #close ⇒ Object
- #open(host, port) ⇒ Object
- #read(bytesNeeded) ⇒ Object
- #settle(seconds) ⇒ Object
- #write(str) ⇒ Object
Instance Method Details
#attach(socket) ⇒ Object
13 14 15 |
# File 'lib/sappho-socket/connected_socket.rb', line 13 def attach socket @socket = socket end |
#close ⇒ Object
33 34 35 |
# File 'lib/sappho-socket/connected_socket.rb', line 33 def close @socket.close end |
#open(host, port) ⇒ Object
17 18 19 |
# File 'lib/sappho-socket/connected_socket.rb', line 17 def open host, port @socket = TCPSocket.new host, port end |
#read(bytesNeeded) ⇒ Object
21 22 23 |
# File 'lib/sappho-socket/connected_socket.rb', line 21 def read bytesNeeded @socket.read bytesNeeded end |
#settle(seconds) ⇒ Object
29 30 31 |
# File 'lib/sappho-socket/connected_socket.rb', line 29 def settle seconds sleep seconds end |
#write(str) ⇒ Object
25 26 27 |
# File 'lib/sappho-socket/connected_socket.rb', line 25 def write str @socket.write str end |