Current implementation cannot allow client to specify server address to listen. It is safe to specify "127.0.0.1" when no access from outside is needed. Also if server picks port number available, it is also handy.
Change the title. Now client can get the listening port when passing zero as a port number to allow system to pick an available port.
Created attachment 392296 [details] PATCH
Comment on attachment 392296 [details] PATCH View in context: https://bugs.webkit.org/attachment.cgi?id=392296&action=review > Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorServer.cpp:61 > + if (isRunning()) > + return WTF::nullopt; Shouldn't this condition be negative?
Comment on attachment 392296 [details] PATCH View in context: https://bugs.webkit.org/attachment.cgi?id=392296&action=review > Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorServer.cpp:52 > auto& endpoint = Inspector::RemoteInspectorSocketEndpoint::singleton(); > + if (isRunning()) > + return false; Also it seems like the early out can precede the declaration here.
Comment on attachment 392296 [details] PATCH View in context: https://bugs.webkit.org/attachment.cgi?id=392296&action=review > Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorServer.cpp:53 > + if (isRunning()) > + return false; > + Shouldn't this go at the start? You don't use endpoint before this check. > Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorServer.h:42 > + JS_EXPORT_PRIVATE Optional<uint16_t> RemoteInspectorServer::getPort(); Copy pasta error?
Comment on attachment 392296 [details] PATCH Sorry for too many casual mistake.
Created attachment 392304 [details] PATCH I got a coffee. My brain is now working.
Comment on attachment 392304 [details] PATCH Clearing flags on attachment: 392304 Committed r257795: <https://trac.webkit.org/changeset/257795>
All reviewed patches have been landed. Closing bug.
<rdar://problem/60007846>