@@ -1535,15 +1535,18 @@ static WC_INLINE void tcp_connect(SOCKET_T* sockfd, const char* ip, word16 port,
15351535 int udp , int sctp , WOLFSSL * ssl )
15361536{
15371537 SOCKADDR_IN_T addr ;
1538+ fprintf (stderr , "connecting to %s:%d\n" , ip , port );
15381539 build_addr (& addr , ip , port , udp , sctp );
15391540 if (udp ) {
15401541 wolfSSL_dtls_set_peer (ssl , & addr , sizeof (addr ));
15411542 }
15421543 tcp_socket (sockfd , udp , sctp );
15431544
15441545 if (!udp ) {
1545- if (connect (* sockfd , (const struct sockaddr * )& addr , sizeof (addr )) != 0 )
1546+ if (connect (* sockfd , (const struct sockaddr * )& addr , sizeof (addr )) != 0 ) {
1547+ perror ("connect" );
15461548 err_sys_with_errno ("tcp connect failed" );
1549+ }
15471550 }
15481551}
15491552
@@ -1555,7 +1558,7 @@ static WC_INLINE void udp_connect(SOCKET_T* sockfd, const char* ip, word16 port)
15551558 SOCKADDR_IN_T addr ;
15561559 build_addr (& addr , ip , port , 1 , 0 );
15571560 if (connect (* sockfd , (const struct sockaddr * )& addr , sizeof (addr )) != 0 )
1558- err_sys_with_errno ("tcp connect failed" );
1561+ err_sys_with_errno ("udp connect failed" );
15591562}
15601563
15611564
@@ -1692,6 +1695,7 @@ static WC_INLINE void tcp_listen(SOCKET_T* sockfd, word16* port, int useAnyAddr,
16921695 }
16931696 }
16941697 #endif
1698+ fprintf (stderr , "listening on port %d\n" , * port );
16951699}
16961700
16971701
0 commit comments