# File lib/phusion_passenger/admin_tools/server_instance.rb, line 87
                def connect(socket_name = :main)
                        socket_info = @server_sockets[socket_name]
                        if !socket_info
                                raise "This process has no server socket named '#{socket_name}'."
                        end
                        if socket_info.address_type == 'unix'
                                return UNIXSocket.new(socket_info.address)
                        else
                                host, port = socket_info.address.split(':', 2)
                                return TCPSocket.new(host, port.to_i)
                        end
                end