Creating a new socket is #new, not #connect
This commit is contained in:
@@ -11,14 +11,14 @@ require 'qmp_client/messages'
|
||||
module QMPClient
|
||||
|
||||
def self.connect_unix(filename, &blk)
|
||||
sock = UNIXSocket.connect(filename)
|
||||
sock = UNIXSocket.new(filename)
|
||||
connect_socket(sock, &blk)
|
||||
ensure
|
||||
sock.close if sock && !sock.closed?
|
||||
end
|
||||
|
||||
def self.connect_tcp(host, port, local_host=nil, local_port=nil, &blk)
|
||||
sock = TCPSocket.connect(host, port, local_host, local_port)
|
||||
sock = TCPSocket.new(host, port, local_host, local_port)
|
||||
connect_socket(sock, &blk)
|
||||
ensure
|
||||
sock.close if sock && !sock.closed?
|
||||
|
Reference in New Issue
Block a user