| ... | ... | @@ -686,6 +686,7 @@ pub const ReadError = error{ |
| 686 | 686 | ConnectionResetByPeer, |
| 687 | 687 | ConnectionTimedOut, |
| 688 | 688 | NotOpenForReading, |
| 689 | SocketNotConnected, |
| 689 | 690 | |
| 690 | 691 | // Windows only |
| 691 | 692 | NetNameDeleted, |
| ... | ... | @@ -732,6 +733,7 @@ pub fn read(fd: fd_t, buf: []u8) ReadError!usize { |
| 732 | 733 | .ISDIR => return error.IsDir, |
| 733 | 734 | .NOBUFS => return error.SystemResources, |
| 734 | 735 | .NOMEM => return error.SystemResources, |
| 736 | .NOTCONN => return error.SocketNotConnected, |
| 735 | 737 | .CONNRESET => return error.ConnectionResetByPeer, |
| 736 | 738 | .TIMEDOUT => return error.ConnectionTimedOut, |
| 737 | 739 | .NOTCAPABLE => return error.AccessDenied, |
| ... | ... | @@ -760,6 +762,7 @@ pub fn read(fd: fd_t, buf: []u8) ReadError!usize { |
| 760 | 762 | .ISDIR => return error.IsDir, |
| 761 | 763 | .NOBUFS => return error.SystemResources, |
| 762 | 764 | .NOMEM => return error.SystemResources, |
| 765 | .NOTCONN => return error.SocketNotConnected, |
| 763 | 766 | .CONNRESET => return error.ConnectionResetByPeer, |
| 764 | 767 | .TIMEDOUT => return error.ConnectionTimedOut, |
| 765 | 768 | else => |err| return unexpectedErrno(err), |
| ... | ... | @@ -800,6 +803,9 @@ pub fn readv(fd: fd_t, iov: []const iovec) ReadError!usize { |
| 800 | 803 | .ISDIR => return error.IsDir, |
| 801 | 804 | .NOBUFS => return error.SystemResources, |
| 802 | 805 | .NOMEM => return error.SystemResources, |
| 806 | .NOTCONN => return error.SocketNotConnected, |
| 807 | .CONNRESET => return error.ConnectionResetByPeer, |
| 808 | .TIMEDOUT => return error.ConnectionTimedOut, |
| 803 | 809 | .NOTCAPABLE => return error.AccessDenied, |
| 804 | 810 | else => |err| return unexpectedErrno(err), |
| 805 | 811 | } |
| ... | ... | @@ -819,7 +825,9 @@ pub fn readv(fd: fd_t, iov: []const iovec) ReadError!usize { |
| 819 | 825 | .ISDIR => return error.IsDir, |
| 820 | 826 | .NOBUFS => return error.SystemResources, |
| 821 | 827 | .NOMEM => return error.SystemResources, |
| 828 | .NOTCONN => return error.SocketNotConnected, |
| 822 | 829 | .CONNRESET => return error.ConnectionResetByPeer, |
| 830 | .TIMEDOUT => return error.ConnectionTimedOut, |
| 823 | 831 | else => |err| return unexpectedErrno(err), |
| 824 | 832 | } |
| 825 | 833 | } |
| ... | ... | @@ -864,7 +872,9 @@ pub fn pread(fd: fd_t, buf: []u8, offset: u64) PReadError!usize { |
| 864 | 872 | .ISDIR => return error.IsDir, |
| 865 | 873 | .NOBUFS => return error.SystemResources, |
| 866 | 874 | .NOMEM => return error.SystemResources, |
| 875 | .NOTCONN => return error.SocketNotConnected, |
| 867 | 876 | .CONNRESET => return error.ConnectionResetByPeer, |
| 877 | .TIMEDOUT => return error.ConnectionTimedOut, |
| 868 | 878 | .NXIO => return error.Unseekable, |
| 869 | 879 | .SPIPE => return error.Unseekable, |
| 870 | 880 | .OVERFLOW => return error.Unseekable, |
| ... | ... | @@ -897,7 +907,9 @@ pub fn pread(fd: fd_t, buf: []u8, offset: u64) PReadError!usize { |
| 897 | 907 | .ISDIR => return error.IsDir, |
| 898 | 908 | .NOBUFS => return error.SystemResources, |
| 899 | 909 | .NOMEM => return error.SystemResources, |
| 910 | .NOTCONN => return error.SocketNotConnected, |
| 900 | 911 | .CONNRESET => return error.ConnectionResetByPeer, |
| 912 | .TIMEDOUT => return error.ConnectionTimedOut, |
| 901 | 913 | .NXIO => return error.Unseekable, |
| 902 | 914 | .SPIPE => return error.Unseekable, |
| 903 | 915 | .OVERFLOW => return error.Unseekable, |
| ... | ... | @@ -1009,6 +1021,9 @@ pub fn preadv(fd: fd_t, iov: []const iovec, offset: u64) PReadError!usize { |
| 1009 | 1021 | .ISDIR => return error.IsDir, |
| 1010 | 1022 | .NOBUFS => return error.SystemResources, |
| 1011 | 1023 | .NOMEM => return error.SystemResources, |
| 1024 | .NOTCONN => return error.SocketNotConnected, |
| 1025 | .CONNRESET => return error.ConnectionResetByPeer, |
| 1026 | .TIMEDOUT => return error.ConnectionTimedOut, |
| 1012 | 1027 | .NXIO => return error.Unseekable, |
| 1013 | 1028 | .SPIPE => return error.Unseekable, |
| 1014 | 1029 | .OVERFLOW => return error.Unseekable, |
| ... | ... | @@ -1035,6 +1050,9 @@ pub fn preadv(fd: fd_t, iov: []const iovec, offset: u64) PReadError!usize { |
| 1035 | 1050 | .ISDIR => return error.IsDir, |
| 1036 | 1051 | .NOBUFS => return error.SystemResources, |
| 1037 | 1052 | .NOMEM => return error.SystemResources, |
| 1053 | .NOTCONN => return error.SocketNotConnected, |
| 1054 | .CONNRESET => return error.ConnectionResetByPeer, |
| 1055 | .TIMEDOUT => return error.ConnectionTimedOut, |
| 1038 | 1056 | .NXIO => return error.Unseekable, |
| 1039 | 1057 | .SPIPE => return error.Unseekable, |
| 1040 | 1058 | .OVERFLOW => return error.Unseekable, |
| ... | ... | @@ -6624,6 +6642,7 @@ pub const RecvFromError = error{ |
| 6624 | 6642 | SystemResources, |
| 6625 | 6643 | |
| 6626 | 6644 | ConnectionResetByPeer, |
| 6645 | ConnectionTimedOut, |
| 6627 | 6646 | |
| 6628 | 6647 | /// The socket has not been bound. |
| 6629 | 6648 | SocketNotBound, |
| ... | ... | @@ -6663,6 +6682,7 @@ pub fn recvfrom( |
| 6663 | 6682 | .WSAENETDOWN => return error.NetworkSubsystemFailed, |
| 6664 | 6683 | .WSAENOTCONN => return error.SocketNotConnected, |
| 6665 | 6684 | .WSAEWOULDBLOCK => return error.WouldBlock, |
| 6685 | .WSAETIMEDOUT => return error.ConnectionTimedOut, |
| 6666 | 6686 | // TODO: handle more errors |
| 6667 | 6687 | else => |err| return windows.unexpectedWSAError(err), |
| 6668 | 6688 | } |
| ... | ... | @@ -6682,6 +6702,7 @@ pub fn recvfrom( |
| 6682 | 6702 | .NOMEM => return error.SystemResources, |
| 6683 | 6703 | .CONNREFUSED => return error.ConnectionRefused, |
| 6684 | 6704 | .CONNRESET => return error.ConnectionResetByPeer, |
| 6705 | .TIMEDOUT => return error.ConnectionTimedOut, |
| 6685 | 6706 | else => |err| return unexpectedErrno(err), |
| 6686 | 6707 | } |
| 6687 | 6708 | } |