File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change 2727#include <stdlib.h>
2828#include <stdio.h>
2929#include <string.h>
30- #include <sys/socket.h>
31- #include <arpa/inet.h>
32- #include <netinet/in.h>
3330#include <unistd.h>
3431
3532/* wolfSSL */
4441#include <wolfssl/wolfcrypt/asn.h>
4542#include <wolfssl/wolfcrypt/error-crypt.h>
4643
44+ #ifdef USE_WINDOWS_API
45+ #include <winsock2.h>
46+ #else
47+ #include <sys/socket.h>
48+ #include <arpa/inet.h>
49+ #include <netinet/in.h>
50+ #endif
51+
4752#if (defined(WOLFSSL_MAXQ1065 ) || defined(WOLFSSL_MAXQ108X )) && \
4853 defined(HAVE_PK_CALLBACKS ) && defined(WOLF_CRYPTO_CB ) && \
4954 !defined(NO_PSK ) && !defined(HAVE_EXTENDED_MASTER ) && \
@@ -181,7 +186,11 @@ static int cmd_line_parse(int argc, char** argv) {
181186int main (int argc , char * * argv )
182187{
183188 int ret , err ;
189+ #ifdef USE_WINDOWS_API
190+ SOCKET sockfd = SOCKET_INVALID ;
191+ #else
184192 int sockfd = SOCKET_INVALID ;
193+ #endif
185194 struct sockaddr_in servAddr ;
186195 char buff [256 ];
187196 size_t len ;
@@ -196,6 +205,10 @@ int main(int argc, char** argv)
196205 goto exit ;
197206 }
198207
208+ #ifdef USE_WINDOWS_API
209+ StartTCP ();
210+ #endif
211+
199212 /* Create a socket that uses an internet IPv4 address.
200213 * Sets the socket to be stream based (TCP).
201214 * 0 means choose the default protocol. */
You can’t perform that action at this time.
0 commit comments