Class: Libuv::TCP::SocketBase
- Inherits:
-
Object
- Object
- Libuv::TCP::SocketBase
- Includes:
- Resource
- Defined in:
- lib/libuv/tcp.rb
Instance Method Summary collapse
- #bind ⇒ Object
- #connect(callback) ⇒ Object
-
#initialize(loop, tcp, ip, port) ⇒ SocketBase
constructor
A new instance of SocketBase.
Methods included from Resource
#check_result, #check_result!, #resolve, #to_ptr
Constructor Details
#initialize(loop, tcp, ip, port) ⇒ SocketBase
Returns a new instance of SocketBase.
134 135 136 |
# File 'lib/libuv/tcp.rb', line 134 def initialize(loop, tcp, ip, port) @tcp, @sockaddr = tcp, ip_addr(ip, port) end |
Instance Method Details
#bind ⇒ Object
138 139 140 |
# File 'lib/libuv/tcp.rb', line 138 def bind check_result!(tcp_bind) end |
#connect(callback) ⇒ Object
142 143 144 |
# File 'lib/libuv/tcp.rb', line 142 def connect(callback) check_result!(tcp_connect(callback)) end |