pharo icon indicating copy to clipboard operation
pharo copied to clipboard

Enhance Socket to show meaningful errors

Open sonibla opened this issue 2 years ago • 1 comments

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

sonibla avatar Aug 19 '22 10:08 sonibla

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.

fmqa avatar Aug 20 '22 10:08 fmqa

Proposed solution in PR

carolahp avatar Nov 21 '22 12:11 carolahp

PR was merged

MarcusDenker avatar Dec 09 '22 14:12 MarcusDenker