X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:from:date:message-id:subject:to :content-type; q=dns; s=default; b=Ro4w5hb6ERg0yVQWFgM1rX55f2Cku GWuC+xkxpzJNjnrjOVIngKPB2wA5STtLCckTKb4CzFJMsktTxr9pYqur4cTKtpsx LBT7nB67oUhr3Q5ifiMBpAmTL0snRHoX54rNareeicTT6wPLwbszMJJzTrg+iVyp KFK5pwZGZOQ/Jo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:from:date:message-id:subject:to :content-type; s=default; bh=KKn1IIyfdKJQi2q2Dax7mMoYQIU=; b=TYP GROV0tH15q+04ruMkNAssjvf0XfY+BpecfJmRkIUGNElI0o0l60QgmcGmM+kkrk+ wOvd0D2C8wuAoieAG1NFva/rS3IDoEgQ4SpHaTgjPBdZLF/wYA/zfrCaIQzyXOhr 1TGlpAKlZpii9Yyd04n2//dHOFJf21eG7bfUP/kk= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=world, Connection, world!, Hx-languages-length:852 X-HELO: mail-lf0-f47.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=9g3AMrAt7G7tnnYzLQlbjizcJWWf/HlwaA9ie4k6aAU=; b=RABSjJ9drqPhxXYLlBUv5Jf07cUHnNkgmWfsQNOBrUumqxrzBarB0OEyAbs0hca3LN OVp9cd9vWfezJ50GoXrc8EYPQcAzxC/1Vdfcu8HLQt4gARjzO7suWPNYsRJ3LQeXfgTO AE0QNIvfe/vPexq87nQw2fkiS/yqKhr2vjL1b6Twd3FpztQRVeWpG5gi4RPR/oxyih9/ wykUGJjFRi3Z1k86C+n1o/zv/qRqoJAsv0oeU5vosoSW/OUhneD0c8Z7Z8NChLsLEDcU 5iKyjrCrPOAoK+HZsuSoMJ4fhUC6c0kMyy0Qpdeui+C81dEbNBGbb0HUErzy6381Ia5H kizQ== X-Gm-Message-State: ALQs6tBnJ2LF8FfJxA+1fA7sO1RIilGVOgNdEH2BE4oMUBG7OV9T+wLb Mvs7vjrTsNDvUkF633v+fJ9w2flbOZkhGMDWtxFbSQ== X-Google-Smtp-Source: AIpwx49S4yi45FhZ+zLxyE4kvSNSr1zHUENqixGXjnxeu7bUJhO3zIDaoG0lst1kBIzf9WXfdW8sl5ulrq9WzFsGYjw= X-Received: by 10.46.97.1 with SMTP id v1mr3470157ljb.62.1524347040436; Sat, 21 Apr 2018 14:44:00 -0700 (PDT) MIME-Version: 1.0 From: R0b0t1 Date: Sat, 21 Apr 2018 16:43:59 -0500 Message-ID: Subject: Unable to Accept TCP Connection To: cygwin AT cygwin DOT com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes 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; state.haddr.sin_addr.s_addr = INADDR_ANY; state.sfd = socket(AF_INET, SOCK_STREAM, 0); if (state.sfd < 0) { perror("socket"); exit(1); } if (bind(state.sfd, (struct sockaddr *)&state.haddr, sizeof(state.haddr)) < 0) { perror("bind"); exit(1); } listen(state.sfd, 5); state.clen = sizeof(state.caddr); state.cfd = accept(state.sfd, (struct sockaddr *)&state.caddr, &state.clen); if (state.cfd < 0) { perror("accept"); exit(1); } printf("Hello, world!\n"); The program was allowed through the Windows firewall. Any hints? Attempting to connect with netcat immediately fails. Cheers, R0b0t1 -- 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