www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22301] New: Only use 'from' if a packet was actually received

https://issues.dlang.org/show_bug.cgi?id=22301

          Issue ID: 22301
           Summary: Only use 'from' if a packet was actually received
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: razvan.nitu1305 gmail.com

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);
}

--
Sep 13