mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Add connection reset error.
This commit is contained in:
@@ -27,6 +27,7 @@ fault NetError
|
||||
ALREADY_CONNECTED,
|
||||
NETWORK_UNREACHABLE,
|
||||
OPERATION_NOT_SUPPORTED_ON_SOCKET,
|
||||
CONNECTION_RESET,
|
||||
}
|
||||
|
||||
fn uint! ipv4toint(String s)
|
||||
|
||||
@@ -39,6 +39,7 @@ fn anyfault convert_error(Errno error)
|
||||
case errno::EALREADY: return NetError.CONNECTION_ALREADY_IN_PROGRESS;
|
||||
case errno::EBADF: return NetError.BAD_SOCKET_DESCRIPTOR;
|
||||
case errno::ECONNREFUSED: return NetError.CONNECTION_REFUSED;
|
||||
case errno::ECONNRESET: return NetError.CONNECTION_RESET;
|
||||
case errno::EISCONN: return NetError.ALREADY_CONNECTED;
|
||||
case errno::ENETUNREACH: return NetError.NETWORK_UNREACHABLE;
|
||||
case errno::ENOTSOCK: return NetError.NOT_A_SOCKET;
|
||||
|
||||
@@ -81,6 +81,7 @@ fn anyfault convert_error(WSAError error)
|
||||
case wsa::ENOTSOCK: return NetError.NOT_A_SOCKET;
|
||||
case wsa::EOPNOTSUPP: return NetError.OPERATION_NOT_SUPPORTED_ON_SOCKET;
|
||||
case wsa::ETIMEDOUT: return NetError.CONNECTION_TIMED_OUT;
|
||||
case wsa::ECONNRESET: return NetError.CONNECTION_RESET;
|
||||
default: return IoError.GENERAL_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user