pharo
pharo copied to clipboard
Enhance Socket to show meaningful errors
Describe the request When you try to listen on a port that another process already listens to, in Pharo you only get a primitive failed (primitiveSocketBindToPort) without more details
Expected behavior If the address is already in use the system should inform the user
Expected development cost If returning the error code from the primitive is possible, I guess it's pretty simple
The error code is accessible using Socket>>sockError
which seems to contain the last POSIX or WSA error code. E.g. this returns 98 (EADDRINUSE) on Linux but using this approach is probably not very portable or idiomatic.
Proposed solution in PR
PR was merged