Closed daipom closed 1 year ago
Though quite late now, I'm starting to think this may be better...
def self.open(path = nil)
return new(path) unless path.nil?
if ServerEngine.windows?
new(0)
else
new(self.generate_path)
end
end
Though quite late now, I'm starting to think this may be better...
def self.open(path = nil) return new(path) unless path.nil? if ServerEngine.windows? new(0) else new(self.generate_path) end end
What do you think? If so, I will fix.
Thanks!
Thanks for your review!
I already created
142
but we need a more fundamental solution as discussed in #140.
This PR enables
ServerEngine::SocketManager::Server.open(nil)
to selectpath
automatically.Especially on Windows, it is hard to search an available port for
path
, so we should use this feature. (The currentgenerate_path
logic sometimes chooses an unavailable port. For example, it does not consider the excluded port range.)This fix keeps backward compatibility.