This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Unable to Accept TCP Connection


R0b0t1 wrote:
The following never prints "Hello, world!"


struct sboot_state {
    struct sockaddr_in haddr;
    struct sockaddr caddr;
    socklen_t clen;
    int sfd, cfd;
} state = { 0 };

state.haddr.sin_family = AF_INET;
state.haddr.sin_port = 2200;

You can use the Windows 'netstat' to see listening connections. See if your app shows up on port 2200. But I suspect you need an htons(2200) on the assignment to sin_port.

..mark


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]