Bug 22301 – Only use 'from' if a packet was actually received
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2021-09-13T10:58:44Z
Last change time
2021-09-14T07:23:54Z
Keywords
pull
Assigned to
No Owner
Creator
RazvanN
Comments
Comment #0 by razvan.nitu1305 — 2021-09-13T10:58:44Z
When trying to receiveFrom a non-blocking UDP socket the program crashes.
unittest
{
byte[] buf;
buf.length = 1;
Address addr;
auto s = new UdpSocket;
s.blocking = false;
s.bind(new InternetAddress(InternetAddress.PORT_ANY));
s.receiveFrom(buf, addr);
}
Comment #1 by razvan.nitu1305 — 2021-09-13T11:01:27Z
This needs `import std.socket`. Sorry for the omission
Comment #2 by dlang-bot — 2021-09-13T11:03:39Z
@Ace17 updated dlang/phobos pull request #7467 "Only use 'from' if a packet was actually received" fixing this issue:
- Fix Issue 22301 - Only use from if a packet was actually received
https://github.com/dlang/phobos/pull/7467
Comment #3 by dlang-bot — 2021-09-14T07:23:54Z
dlang/phobos pull request #7467 "Only use 'from' if a packet was actually received" was merged into master:
- 6eb14972adb82796ffa10a14c03553399bee230c by RazvanN7:
Fix Issue 22301 - Only use from if a packet was actually received
https://github.com/dlang/phobos/pull/7467