Class: TCPTimeoutSocket
- Inherits:
-
Object
show all
- Defined in:
- lib/memcache.rb
Overview
TCPSocket facade class which implements timeouts.
Instance Method Summary
collapse
Constructor Details
Returns a new instance of TCPTimeoutSocket.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args) ⇒ Object
837
838
839
|
# File 'lib/memcache.rb', line 837
def method_missing(meth, *args)
@sock.__send__(meth, *args)
end
|
Instance Method Details
#_socket ⇒ Object
833
834
835
|
# File 'lib/memcache.rb', line 833
def _socket
@sock
end
|
#gets(*args) ⇒ Object
821
822
823
824
825
|
# File 'lib/memcache.rb', line 821
def gets(*args)
Timeout::timeout(@len, SocketError) do
@sock.gets(*args)
end
end
|
#read(*args) ⇒ Object
827
828
829
830
831
|
# File 'lib/memcache.rb', line 827
def read(*args)
Timeout::timeout(@len, SocketError) do
@sock.read(*args)
end
end
|
#write(*args) ⇒ Object
815
816
817
818
819
|
# File 'lib/memcache.rb', line 815
def write(*args)
Timeout::timeout(@len, SocketError) do
@sock.write(*args)
end
end
|