Ticket #548 (closed RFC: invalid)
Error handling in socket system
Reported by: | whiteknight | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | core | Version: | |
Severity: | medium | Keywords: | socket |
Cc: | Language: | ||
Patch status: | Platform: | all |
Description
Browsing through the socket system, I see a few places where error conditions don't seem to be handled in a way consistent with the rest of Parrot. Some examples:
src/io/socket_win32.c:get_sockaddr_in(). there are a few "XXX" comments here about poor error handling, and a bare fprintf(stderr, ...) call that should probably be replaced with a Parrot_warn() or a thrown exception.
Same thing in src/io/socket_unit.c:get_sockaddr_in().
Various platform-specific functions are returning platform-specific error codes, as is evidenced in places like src/io/socket_api.c:Parrot_io_socket_is_closed(). We should have a more unified way to say whether a function has succeeded or failed without using a large ugly #ifdef/#endif chain