delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/09/30/07:51:27

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:from:to:subject:date:message-id:reply-to
:mime-version:content-type; q=dns; s=default; b=N1c2pGn7Et8Ttax+
BUT1uPZvqtEAOd5bgKcGYt56jjEdaVB6M4TR+m50xagqOyyfKs1JZxWIbblIEOh9
lNxvoFJ/feG6jKoB47xYFtwp2k5Vt3aDm+PS3+5mYbgp2HMb+nC3rfmYmo5tdzm/
M7qROkAd7oxh0F1h6VVffG0LLfg=
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:from:to:subject:date:message-id:reply-to
:mime-version:content-type; s=default; bh=LFMT+HlM25EBpxeH1qWIwJ
U53bY=; b=kQbsSme8JnjECuYkW66OQgzXBIcJHoEL9Ppvb5ClhodP1ojfPRJfNX
nJqLw9qKmohBlhoBe6xAb5EwqQrx43GEu2zeCNVme9StnnkFHaUQgl5JOKUJ2zz1
A96OimjoLxIeRS/5KFlJSyh42G3+MnvNLN5LBVcxwsB3k/26stK2A=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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=-6.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=forever, Hx-languages-length:1465, signals, viruses
X-HELO: mail-io0-f171.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:reply-to :user-agent:mime-version; bh=TV5ci/TKlqWLpJu0AOoLhTPDAGdmhDYIs8c+T4qB9K4=; b=qfBbZb/8v5M1npwO3dryJYpdRFpJpHKC7H9uwzp+swxVZl5dp0EWvJpO2dr3X4n3IV 777GW0l+NfeeemIFUb+ZoorDJIoVpHTP4C01Hv1sIZFK1vr6Cikn3WyBUGjDyrDqsQIN 1ruV9L2BX/OHWWpp/DzYPeKBVXQS6WmwhWEazLzXoU2IegMPWXQh//qhHzXW+HO8kyk8 sF68/Mz0dIb16zomVNrh+4nF/RjssTIlhAaAweTTdFij888YoA+p0461ZqBZt9S1twP6 Ayamzl1QyxJX9tv6eOBDrcw1w6uG4kuwUOXn66AiBH72953RNg3jaWnz031LCgaEzlYi PfKg==
X-Gm-Message-State: AMCzsaUSeY8MLRGZ+2TbbpkqsjktAOz6vg8ndaej+j9ZHGSxSIXn2Cob 50XFijOWiLq5KntN9gEbcnm4Qibn
X-Google-Smtp-Source: AOwi7QAwRSvYrkjEHFmgbqFsdY1vyI37UjJDK1nmo5+HeX5inyluY1Aqn92rStvN1G+dHri4TdgKXQ==
X-Received: by 10.107.18.100 with SMTP id a97mr16303041ioj.41.1506772262331; Sat, 30 Sep 2017 04:51:02 -0700 (PDT)
From: tvonderhaar <tlvonderhaar AT gmail DOT com>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: SIGIO using UDP sockets just hangs (permantely blocks) socket I/O.
Date: Sat, 30 Sep 2017 11:50:59 +0000
Message-Id: <embecdb725-8b17-4963-84ed-12e570da7532@str-c>
Reply-To: tvonderhaar <tlvonderhaar AT gmail DOT com>
User-Agent: eM_Client/7.1.30794.0
Mime-Version: 1.0

--------=_MB9C53EE1A-F871-4BA5-8191-62F1EE2BB197
Content-Type: text/plain; format=flowed; charset=utf-8
Content-Transfer-Encoding: quoted-printable

     Dear cygwin_list,

     I have tried to get signals working with UDP bound sockets. I have
tried every combination and order of the included code, but once I
ioctl() the socket with "FIOASYNC" I get one signal from the socket and
the previously "FNDELAY" set socket blocks forever on a call to
recvfrom(). I can detect the block with a select, but it never becomes
ready. This code works flawlessly on Linux and in the past worked on
SUN,HP- UX(I remove the HP specific code) and Alpha OSes. If I don't
perform the ioctl() with "FIOASYNC" or perform a second call to ioctl()
with the "set_state=3D0" the socket does not block as expected, but I of
course I don't get my SIGIO signal. Note: I make the call to the
function as follows:

    set_io_async(udp_socket_fd,call_back,SIGIO,FALSE);
   /*FASLE defined as '0' and SIGIO as defined by CYGWIN.*/

  I only found one google search of an individual attempting non-blocking
asynchronous() I/O and they indicated it worked using this code sequence
under CYGWIN. "FASYNC" has no affect on CYGWIN using fcntl() as after
setting that flag with "F_SETFL" and reading the flags back with
"F_GETFL" the flag is not set.

     Some help would be appreciated. I know some feel signals are
obsolete but I don't and I have used them over for 20+ years. Thanks.

       Tom

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

--------=_MB9C53EE1A-F871-4BA5-8191-62F1EE2BB197
Content-Type: application/octet-stream; name=sigio.c
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=sigio.c

LyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKlN0YXJ0LXNldF9p
b19hc3luYyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLypUaGlzIEZ1
bmN0aW9uIHNldHMgdXAgYSBzaWduYWwgY2FsbCBiYWNrIGZ1bmN0aW9uICco
KmNhbGxfYmFjaykoKScgdG8gYmUKICBjYWxsZWQgYXN5bmNocm9ub3VzbHkg
d2hlbiBJL08gaXMgYXZhaWxhYmxlIG9uIHRoZSBmaWxlIGRlc2NyaXB0b3Ig
J2ZkJy4KICBUa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xlci4qLwogICAgICByZXR1cm4oLTEpOwog
ICB9CiMgIGVsc2UKICAgLypHZXQgY3VycmVudCBzb2NrZXQgZmxhZ3MuKi8K
ICAgaWYoKGZsYWdzPWZjbnRsKGZkLEZfR0VURkwsMCkpPDApewogICAgICBE
QlBSSU5URigyLCJmY250bChGX0dFVEZMKSBmYWlsZWQuXG4iKTsKICAgICAg
c2lnYWN0aW9uKHJ0X3NpZ19ubywmb3JnX3NpZ25hbF9oYW5kbGVyLE5VTEwp
Oy8qUmVzdG9yZSBvbGQgaGFuZGxlci4qLwogICAgICByZXR1cm4oLTEpOwog
ICB9CiAgIGZsYWdzfD0od2FpdCk/KEZBU1lOQyk6KEZOREVMQVl8RkFTWU5D
KTsKICAgLypBbGxvdyByZWNlaXB0IG9mIGFzeW5jaHJvbm91cyBJL08gc2ln
bmFscyBhbmQgc2V0IG5vbi1ibG9ja2luZyBJL08uKi8KICAgaWYoZmNudGwo
ZmQsRl9TRVRGTCxmbGFncyk8MCl7CiAgICAgIERCUFJJTlRGKDIsImZjbnRs
KEZfU0VURkwpIGZhaWxlZC5cbiIpOwogICAgICBzaWdhY3Rpb24ocnRfc2ln
X25vLCZvcmdfc2lnbmFsX2hhbmRsZXIsTlVMTCk7LypSZXN0b3JlIG9sZCBo
YW5kbGVyLiovCiAgICAgIHJldHVybigtMSk7CiAgIH0KI2VuZGlmCgogICAv
Kkdvb2QgcmV0dXJuLiovCiAgIHJldHVybigwKTsKfQovKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKkVuZC1zZXRfaW9fYXN5bmMqKioqKioq
KioqKioqKioqKioqKioqKioqKioqLwo=


--------=_MB9C53EE1A-F871-4BA5-8191-62F1EE2BB197
Content-Type: text/plain; charset=us-ascii


--
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
--------=_MB9C53EE1A-F871-4BA5-8191-62F1EE2BB197--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019