X-Spam-Check-By: sourceware.org From: Vadim Melihow To: cygwin AT cygwin DOT com Subject: Very Strange while udp socket polling. Date: Tue, 10 Oct 2006 21:47:38 +0400 User-Agent: KMail/1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200610102147.38602.slon@satgate.net> X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Hello, Just very simple program and very strange behaviour.... int main() { int fd; struct pollfd pds[2]; struct sockaddr_in sai; fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); sai.sin_family = AF_INET; sai.sin_port = htons(6666); sai.sin_addr.s_addr = INADDR_ANY; bind(fd, (struct sockaddr *)&sai,sizeof(sai)); printf("Before poll. Sleep 10 sec.\n"); sleep(10); pds[0].fd = fd; pds[0].events = POLLIN|POLLERR; pds[0].revents = 0; poll(pds, 1, (int)(5000)); printf("After poll\n"); sleep(1000); } So, before "poll(pds, 1, (int)(5000));" netstat -a -n shows Slon AT HOBOT ~/ $ netstat -a -n -o |grep 2860 UDP 0.0.0.0:6666 *:* 2860 And after poll Slon AT HOBOT ~/ $ netstat -a -n -o |grep 2860 UDP 0.0.0.0:6666 *:* 2860 UDP 127.0.0.1:3074 *:* 2860 why 'poll' create and bind new socket?? Is this a bug?? tested on cygwin1.dll v.1.5.21 a some older.... Vadim G Melihow -- 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/