dart-archive / sdk

The Dartino project was an experiment seeking to improve productivity when writing application code for embedded devices.
https://dartino.org
Other
331 stars 36 forks source link

Can't bind STM32 DatagramSocket to INADDR_ANY ("0.0.0.0") #590

Closed christiansiegel closed 8 years ago

christiansiegel commented 8 years ago

It's not possible to bind the STM32 DatagramSocket (sdk/pkg/stm32/lib/socket.dart) to INADDR_ANY ("0.0.0.0") because _lookupHost() also returns 0 for invalid addresses, which causes an exception in line 199.

The POSIX DatagramSocket (sdk/pkg/socket/lib/socket.dart) doesn't have this issue, since sys.lookup() parses "0.0.0.0" to a valid InternetAddress and an error would only be thrown if the lookup returns null.