Class: NetworkFacade::TCP::Client

Inherits:
Base::Client show all
Defined in:
lib/network-facade/tcp.rb

Instance Method Summary collapse

Methods inherited from Base::Client

#__read__, #__write__, inherited, #method_missing, uri=

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



12
13
14
15
16
17
# File 'lib/network-facade/tcp.rb', line 12

def initialize(options = {})
	super
	@options[:no_delay] ||= true
	@client ||= TCPSocket.new(@uri.host || 'localhost', @uri.port || PORT)
	@client.setsockopt(Socket::SOL_TCP, Socket::TCP_NODELAY, 1) if @options[:no_delay]
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class NetworkFacade::Base::Client