delorie.com/archives/browse.cgi | search |
That's a bug in your code. You're giving an uninitialized pointer and an uninitialized length to accept. Try this: On Sep 23 15:31, Mailing List wrote: #include <errno.h> [...] #ifdef THAT_WOULD_BE_BETTER clilen = sizeof (struct sockaddr_in); cliaddr = alloca (clilen); #endif > /* Infinite loop waiting for connections */ > for(;;) > { > connfd = accept(listenfd, (struct sockaddr *) cliaddr, &clilen); if (connfd < 0) printf ("Errno: %d <%s>\n", errno, strerror(errno)); > > > /* Here would be a pthread_create to handle the incomming connection */ > > } > > return 0; > } Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader mailto:cygwin AT cygwin DOT com Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |