winsock2

    1热度

    1回答

    我正在编写一个UDP服务器作为应用程序的一部分。在以下代码片段中: int ServerManager::onListen(void * data) { int numbytes; char buf[512]; socklen_t addrlen = sizeof(sockaddr_in); struct sockaddr_in addr; if

    1热度

    1回答

    Winsock注册I/O需要什么? 我使用的是Windows 10和Visual Studio 2015年社区UPDATE3 MSDN Winsock Include Files是我能找到的唯一的事情,这是非常模糊。 这是唯一的Winsock2包括我能找到的: #include <WinSock2.h> #include <WS2tcpip.h> #include <MSWSock.h> #

    2热度

    1回答

    在程序终止期间,如何通过调用GetQueuedCompletionStatus()解锁先前被阻止的线程?

    1热度

    1回答

    我想写一个C++ DLL,它使用openSSL来保护到服务器的连接。 我genuinly的事实,该代码 #include "stdafx.h" #include <string.h> #include <iostream> //SSL stuff #include <openssl/ssl.h> #include <openssl/err.h> #include <openssl/pe

    4热度

    1回答

    我有以下简化的IO完成端口服务器C++代码: int main(..) { startCompletionPortThreadProc(); // Await client connection sockaddr_in clientAddress; int clientAddressSize = sizeof(clientAddress);

    0热度

    1回答

    我开发了将消息发送到服务器的IOCP客户端应用程序。现在我想在其中添加SSL支持,以便使用OpenSSL连接启用了SSL的服务器应用程序。 我使用 /* Load encryption & hashing algorithms for the SSL program */ SSL_library_init(); /* Load the error strings for SSL & CRYP

    2热度

    2回答

    为什么socket()没有返回INVALID_SOCKET?我认为它会失败,然后我可以退出我的功能。我的函数的错误检查一直持续到recvfrom(),然后在没有互联网连接时挂起。我以为socket()或sendto()会返回一个错误代码,当我没有互联网连接,但他们不是。我试图依靠他们的失败作为一个标志,用户没有互联网连接并退出我的功能,但这只是不工作的一些奇怪的原因。 void myFunc()

    -2热度

    1回答

    我正在使用winsock2在C++中编写套接字程序,我试图使用WSAAccept来有条件地接受连接。我复制了来自MSDN的示例ConditionalFunction,以获取WSAAccept中的lpfnCondition参数,如下所示。 SOCKET WSAAccept( _In_ SOCKET s, _Out_ struct sockaddr *addr, _In

    1热度

    1回答

    我想写一个连接到OpenSSL服务器的C++应用程序。 我可以发送数据,到达未损坏的服务器,但读取操作只读取1个字节。 代码: char* dest_url = "147.87.116.74"; X509 *cert = NULL; X509_name_st *certname = NULL; const SSL_METHOD *method; SSL_CTX *ctx; SS

    1热度

    2回答

    我正在从Visual Studio 2013更新到Visual Studio 2015,并注意到这种行为差异。 #include <stdexcept> #include <WinSock2.h> #include <ws2tcpip.h> int main() { WORD version = MAKEWORD(2, 2); WSADATA wsaData;