diff options
Diffstat (limited to 'demos/sslecho/main.c')
-rw-r--r-- | demos/sslecho/main.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/demos/sslecho/main.c b/demos/sslecho/main.c index c75eac2bc3..4973902cf5 100644 --- a/demos/sslecho/main.c +++ b/demos/sslecho/main.c @@ -8,14 +8,19 @@ */ #include <stdio.h> -#include <unistd.h> #include <string.h> -#include <sys/socket.h> -#include <arpa/inet.h> -#include <netinet/in.h> +#include <signal.h> #include <openssl/ssl.h> #include <openssl/err.h> #include <signal.h> +#if !defined(OPENSSL_SYS_WINDOWS) +#include <unistd.h> +#include <sys/socket.h> +#include <arpa/inet.h> +#include <netinet/in.h> +#else +#include <winsock.h> +#endif static const int server_port = 4433; @@ -153,8 +158,10 @@ int main(int argc, char **argv) struct sockaddr_in addr; unsigned int addr_len = sizeof(addr); +#if !defined (OPENSSL_SYS_WINDOWS) /* ignore SIGPIPE so that server can continue running when client pipe closes abruptly */ signal(SIGPIPE, SIG_IGN); +#endif /* Splash */ printf("\nsslecho : Simple Echo Client/Server : %s : %s\n\n", __DATE__, |