Class: Nonnative::CloseAllSocketPair
- Inherits:
-
SocketPair
- Object
- SocketPair
- Nonnative::CloseAllSocketPair
- Defined in:
- lib/nonnative/close_all_socket_pair.rb
Overview
Socket-pair variant used by the fault-injection proxy to simulate immediate connection failure.
When active, the proxy accepts a TCP connection and closes it immediately without forwarding any bytes to the upstream service.
This behavior is enabled by calling FaultInjectionProxy#close_all.
Instance Method Summary collapse
-
#connect(local_socket) ⇒ void
Closes the accepted socket immediately.
Methods inherited from SocketPair
Constructor Details
This class inherits a constructor from Nonnative::SocketPair
Instance Method Details
#connect(local_socket) ⇒ void
This method returns an undefined value.
Closes the accepted socket immediately.
19 20 21 22 23 |
# File 'lib/nonnative/close_all_socket_pair.rb', line 19 def connect(local_socket) Nonnative.logger.info "closing socket '#{local_socket.inspect}' for 'close_all' pair" local_socket.close end |