Class: Net::SocketHttp
- Inherits:
-
HTTP
- Object
- HTTP
- Net::SocketHttp
- Defined in:
- lib/cangrejo/net/socket_http.rb
Overview
Overrides the connect method to simply connect to a unix domain socket.
Instance Attribute Summary collapse
-
#socket_path ⇒ Object
readonly
Returns the value of attribute socket_path.
Instance Method Summary collapse
-
#addr_port ⇒ Object
Override to prevent errors concatenating relative URI objects.
-
#connect ⇒ Object
Create the socket object.
-
#initialize(_socket_path, _dummy = nil) ⇒ SocketHttp
constructor
URI should be a relative URI giving the path on the HTTP server.
Constructor Details
#initialize(_socket_path, _dummy = nil) ⇒ SocketHttp
URI should be a relative URI giving the path on the HTTP server.
socket_path is the filesystem path to the socket the server is listening to.
10 11 12 13 |
# File 'lib/cangrejo/net/socket_http.rb', line 10 def initialize(_socket_path, _dummy=nil) @socket_path = _socket_path super end |
Instance Attribute Details
#socket_path ⇒ Object (readonly)
Returns the value of attribute socket_path.
6 7 8 |
# File 'lib/cangrejo/net/socket_http.rb', line 6 def socket_path @socket_path end |
Instance Method Details
#addr_port ⇒ Object
Override to prevent errors concatenating relative URI objects.
22 23 24 |
# File 'lib/cangrejo/net/socket_http.rb', line 22 def addr_port File.basename(socket_path) end |
#connect ⇒ Object
Create the socket object.
16 17 18 19 |
# File 'lib/cangrejo/net/socket_http.rb', line 16 def connect @socket = Net::BufferedIO.new UNIXSocket.new socket_path on_connect end |