1234567891011121314151617181920212223242526272829303132333435 |
- #ifdef UA_ARCHITECTURE_WIN32
- #include <open62541/types.h>
- unsigned int UA_socket_set_blocking(UA_SOCKET sockfd){
- u_long iMode = 0;
- if(ioctlsocket(sockfd, FIONBIO, &iMode) != NO_ERROR)
- return UA_STATUSCODE_BADINTERNALERROR;
- return UA_STATUSCODE_GOOD;;
- }
- unsigned int UA_socket_set_nonblocking(UA_SOCKET sockfd){
- u_long iMode = 1;
- if(ioctlsocket(sockfd, FIONBIO, &iMode) != NO_ERROR)
- return UA_STATUSCODE_BADINTERNALERROR;
- return UA_STATUSCODE_GOOD;;
- }
- void UA_initialize_architecture_network(void){
- WSADATA wsaData;
- WSAStartup(MAKEWORD(2, 2), &wsaData);
- }
- void UA_deinitialize_architecture_network(void){
- WSACleanup();
- }
- #endif
|