Class: EasySockets::TcpSocket
- Inherits:
-
BasicSocket
- Object
- BasicSocket
- EasySockets::TcpSocket
- Defined in:
- lib/easy_sockets/tcp/tcp_socket.rb
Overview
Subclass of BasicSocket that implement a TCP socket.
Constant Summary
Constants inherited from BasicSocket
Instance Attribute Summary
Attributes inherited from BasicSocket
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ TcpSocket
constructor
It also accepts all options that BasicSocket#initialize accepts.
Methods inherited from BasicSocket
#connect, #disconnect, #send_msg
Methods included from Utils
Constructor Details
#initialize(opts = {}) ⇒ TcpSocket
It also accepts all options that BasicSocket#initialize accepts
16 17 18 19 20 21 22 |
# File 'lib/easy_sockets/tcp/tcp_socket.rb', line 16 def initialize(opts={}) super(opts) @port = opts[:port].to_i @port = DEFAULT_PORT if @port <= 0 @host = opts[:host] || DEFAULT_HOST end |