| 1 | module net |
| 2 | |
| 3 | pub const fionbio = u32(0x8004667e) |
| 4 | |
| 5 | // WsaError is the subset of Windows socket errors needed for cross C generation. |
| 6 | pub enum WsaError { |
| 7 | wsaeintr = 10004 |
| 8 | wsaewouldblock = 10035 |
| 9 | wsaeinprogress = 10036 |
| 10 | wsaeafnosupport = 10047 |
| 11 | wsaeaddrnotavail = 10049 |
| 12 | wsaenetdown = 10050 |
| 13 | wsaenetunreach = 10051 |
| 14 | wsaenotconn = 10057 |
| 15 | wsaeconnrefused = 10061 |
| 16 | wsaehostdown = 10064 |
| 17 | wsaehostunreach = 10065 |
| 18 | wsaeprotonosupport = 10043 |
| 19 | wsaetimedout = 10060 |
| 20 | wsahost_not_found = 11001 |
| 21 | wsatry_again = 11002 |
| 22 | wsano_recovery = 11003 |
| 23 | wsano_data = 11004 |
| 24 | wsa_ipsec_name_policy_error = 11033 |
| 25 | } |
| 26 | |
| 27 | // wsa_error casts an int to its WsaError value. |
| 28 | pub fn wsa_error(code int) WsaError { |
| 29 | return unsafe { WsaError(code) } |
| 30 | } |
| 31 | |