repository
0.0.0-20240812002629-296f2798b6b5
Repository: https://github.com/k4rian/winsock2-go.git
Documentation: pkg.go.dev
# README
winsock2-go
WinSock2 API binding for Go without CGO.
API Status • Installation • Usage • License
API Status
Click to expand
Status | Function | C++ | Notes |
---|---|---|---|
__WSAFDIsSet | __WSAFDIsSet | ||
Accept | accept | ||
Bind | bind | ||
CloseSocket | closesocket | ||
Connect | connect | ||
FreeAddrInfoA | freeaddrinfo | ||
FreeAddrInfoEx | FreeAddrInfoEx | ||
FreeAddrInfoExW | FreeAddrInfoExW | ||
FreeAddrInfoW | FreeAddrInfoW | ||
GetAddrInfoA | getaddrinfo | ||
GetAddrInfoExA | GetAddrInfoExA | ||
GetAddrInfoExCancel | GetAddrInfoExCancel | ||
GetAddrInfoExOverlappedResult | GetAddrInfoExOverlappedResult | ||
GetAddrInfoExW | GetAddrInfoExW | ||
GetAddrInfoW | GetAddrInfoW | ||
GetHostByAddr | gethostbyaddr | ||
GetHostByName | gethostbyname | ||
GetHostNameA | gethostname | ||
GetHostNameW | GetHostNameW | ||
GetNameInfoA | getnameinfo | ||
GetNameInfoW | GetNameInfoW | ||
GetPeerName | getpeername | ||
GetProtoByName | getprotobyname | ||
GetProtoByNumber | getprotobynumber | ||
GetServByName | getservbyname | ||
GetServByPort | getservbyport | ||
GetSockName | getsockname | ||
GetSockOpt | getsockopt | ||
Htond | htond | Reimplemented in pure Go. | |
Htonf | htonf | Reimplemented in pure Go. | |
Htonl | htonl | Reimplemented in pure Go. | |
Htonll | htonll | Reimplemented in pure Go. | |
Htons | htons | Reimplemented in pure Go. | |
InetAddr | inet_addr | ||
InetNtoa | inet_ntoa | Reimplemented in pure Go. | |
InetNtop | inet_ntop | ||
InetNtopW | InetNtopW | ||
InetPton | inet_pton | ||
InetPtonW | InetPtonW | ||
IoctlSocket | ioctlsocket | ||
Listen | listen | ||
Ntohd | ntohd | Ignored. | |
Ntohf | ntohf | Ignored. | |
Ntohl | ntohl | Reimplemented in pure Go. | |
Ntohll | ntohll | Ignored. | |
Ntohs | ntohs | Reimplemented in pure Go. | |
Recv | recv | ||
RecvFrom | recvfrom | ||
Select | select | ||
Send | send | ||
SendTo | sendto | ||
SetAddrInfoExA | SetAddrInfoExA | ||
SetAddrInfoExW | SetAddrInfoExW | ||
SetSockOpt | setsockopt | ||
Shutdown | shutdown | ||
Socket | socket | ||
SocketNotificationRetrieveEvents | SocketNotificationRetrieveEvents | Ignored. | |
Wah* | Ignored. | ||
WEP | WEP | Ignored. | |
WPUCompleteOverlappedRequest | WPUCompleteOverlappedRequest | Ignored. | |
WPUGetProviderPathEx | WPUGetProviderPathEx | Ignored. | |
WSAAccept | WSAAccept | The condition and callbackData parameters are always ignored. | |
WSAAddressToStringA | WSAAddressToStringA | ||
WSAAddressToStringW | WSAAddressToStringW | ||
WSAAdvertiseProvider | WSAAdvertiseProvider | Ignored. | |
WSAAsyncGetHostByAddr | WSAAsyncGetHostByAddr | Ignored. | |
WSAAsyncGetHostByName | WSAAsyncGetHostByName | Ignored. | |
WSAAsyncGetProtoByName | WSAAsyncGetProtoByName | Ignored. | |
WSAAsyncGetProtoByNumber | WSAAsyncGetProtoByNumber | Ignored. | |
WSAAsyncGetServByName | WSAAsyncGetServByName | Ignored. | |
WSAAsyncGetServByPort | WSAAsyncGetServByPort | Ignored. | |
WSAAsyncSelect | WSAAsyncSelect | Ignored. | |
WSACancelAsyncRequest | WSACancelAsyncRequest | Ignored. | |
WSACancelBlockingCall | WSACancelBlockingCall | Ignored. | |
WSACleanup | WSACleanup | ||
WSACloseEvent | WSACloseEvent | ||
WSAConnect | WSAConnect | ||
WSAConnectByList | WSAConnectByList | Can't get it to work (SocketAddressList issue?). | |
WSAConnectByNameA | WSAConnectByNameA | ||
WSAConnectByNameW | WSAConnectByNameW | ||
WSACreateEvent | WSACreateEvent | ||
WSADuplicateSocketA | WSADuplicateSocketA | ||
WSADuplicateSocketW | WSADuplicateSocketW | ||
WSAEnumNameSpaceProvidersA | WSAEnumNameSpaceProvidersA | ||
WSAEnumNameSpaceProvidersExA | WSAEnumNameSpaceProvidersExA | ||
WSAEnumNameSpaceProvidersExW | WSAEnumNameSpaceProvidersExW | ||
WSAEnumNameSpaceProvidersW | WSAEnumNameSpaceProvidersW | ||
WSAEnumNetworkEvents | WSAEnumNetworkEvents | ||
WSAEnumProtocolsA | WSAEnumProtocolsA | ||
WSAEnumProtocolsW | WSAEnumProtocolsW | ||
WSAEventSelect | WSAEventSelect | ||
WSAGetLastError | WSAGetLastError | Always returns 0. | |
WSAGetOverlappedResult | WSAGetOverlappedResult | ||
WSAGetQOSByName | WSAGetQOSByName | The WSABuf isn't populated, even with a NT string. | |
WSAGetServiceClassInfoA | WSAGetServiceClassInfoA | Can't get it to work: "An invalid argument was supplied.". | |
WSAGetServiceClassInfoW | WSAGetServiceClassInfoW | Can't get it to work: "An invalid argument was supplied.". | |
WSAGetServiceClassNameByClassIdA | WSAGetServiceClassNameByClassIdA | Crash, tried many approaches without success. (0xc0000005 - Access Violation) | |
WSAGetServiceClassNameByClassIdW | WSAGetServiceClassNameByClassIdW | Crash, tried many approaches without success. (0xc0000005 - Access Violation) | |
WSAHtonl | WSAHtonl | ||
WSAHtons | WSAHtons | ||
WSAInstallServiceClassA | WSAInstallServiceClassA | Raise an "A socket operation was attempted to an unreachable host" error(?). | |
WSAInstallServiceClassW | WSAInstallServiceClassW | Raise an "A socket operation was attempted to an unreachable host" error(?). | |
WSAIoctl | WSAIoctl | The completionRoutine parameter is always ignored. | |
WSAIsBlocking | WSAIsBlocking | Ignored. | |
WSAJoinLeaf | WSAJoinLeaf | Untested. | |
WSALookupServiceBeginA | WSALookupServiceBeginA | ||
WSALookupServiceBeginW | WSALookupServiceBeginW | ||
WSALookupServiceEnd | WSALookupServiceEnd | ||
WSALookupServiceNextA | WSALookupServiceNextA | ||
WSALookupServiceNextW | WSALookupServiceNextW | Crash, even with a valid handle from WSALookupServiceBeginW. | |
WSANSPIoctl | WSANSPIoctl | The completion parameter is always ignored. | |
WSANtohl | WSANtohl | ||
WSANtohs | WSANtohs | ||
WSAPoll | WSAPoll | ||
WSAProviderCompleteAsyncCall | WSAProviderCompleteAsyncCall | Ignored. | |
WSAProviderConfigChange | WSAProviderConfigChange | The completionRoutine parameter is always ignored. | |
WSARecv | WSARecv | The completionRoutine parameter is always ignored. | |
WSARecvDisconnect | WSARecvDisconnect | ||
WSARecvFrom | WSARecvFrom | The completionRoutine parameter is always ignored. | |
WSARemoveServiceClass | WSARemoveServiceClass | ||
WSAResetEvent | WSAResetEvent | ||
WSASend | WSASend | The completionRoutine parameter is always ignored. | |
WSASendDisconnect | WSASendDisconnect | ||
WSASendMsg | WSASendMsg | Untested / The completionRoutine parameter is always ignored. | |
WSASendTo | WSASendTo | The completionRoutine parameter is always ignored. | |
WSASetBlockingHook | WSASetBlockingHook | Ignored. | |
WSASetEvent | WSASetEvent | ||
WSASetLastError | WSASetLastError | Seems to works, not sure with the GetLastError issue. | |
WSASetServiceA | WSASetServiceA | Seems to works, not depth tested. | |
WSASetServiceW | WSASetServiceW | Seems to works, not depth tested. | |
WSASocketA | WSASocketA | ||
WSASocketW | WSASocketW | ||
WSAStartup | WSAStartup | ||
WSAStringToAddressA | WSAStringToAddressA | ||
WSAStringToAddressW | WSAStringToAddressW | ||
WSAUnadvertiseProvider | WSAUnadvertiseProvider | Ignored. | |
WSAUnhookBlockingHook | WSAUnhookBlockingHook | Ignored. | |
WSAWaitForMultipleEvents | WSAWaitForMultipleEvents | ||
WSApSetPostRoutine | WSApSetPostRoutine | Ignored. | |
WSC* | Ignored. |
Implemented
Partial
Broken
Unimplemented
Installation
To install the package, use go get
:
go get -u github.com/K4rian/winsock2-go
Then import it in your project:
import "github.com/K4rian/winsock2-go/ws2"
Usage
See examples/