22 Commits

Author SHA1 Message Date
Gordon Williams
253ff899b5 Add TODOs for cleaning up UDP 2018-03-13 09:37:47 +00:00
Gordon Williams
5ac4aba92a squashing warnings 2018-01-24 09:04:17 +00:00
Standa Opichal
4ccfb4fa8a Support for dgram.createSocket({ reuseAddr: true }) 2017-09-15 00:05:16 +02:00
wilberforce
4f0fa4af4e UDP testing 2017-09-02 16:11:57 +12:00
Standa Opichal
f3378c4a8d Added size to UDP buf header.
This is in order to be able to call several socket.send() calls
to different targets synchronously.

The format changed to host/32:port/16:size/16:[data/??].
2017-08-25 23:49:03 +02:00
Standa Opichal
2ae6041697 DBG instead of jsWarn where appropriate 2017-08-25 23:48:18 +02:00
Standa Opichal
54412b268a SocketType parameters in net->send/recv/createsocket
And also in their callers (netSend/Recv/CreateSocket).
2017-08-25 23:48:18 +02:00
Standa Opichal
1b139eb547 UDP host:port embedded in send/recv buf 2017-08-25 23:48:18 +02:00
Standa Opichal
bc3d4cbb46 Passing addMembership() args to net.createsocket
Limited to a single membership, handled in target specific createsocket
which is provided with the 'options' object to get multicastGroup and
multicastIp from. Also due to the way the arguments are passed to the
net.createsocket the socket.addMembership() needs to be called before
socket.bind().

Added SO_REUSEPORT so that binding e.g. to mDNS port 5353 is possible
on an osx machine.
2017-08-25 23:48:18 +02:00
Standa Opichal
f3a2e566ad netRecv to use recvfrom to get replyTo address
Provided the second 'data' event `info` argument to be able to reply
(message origin host/port combination).
Added dgram_send `options` and other jsvUnlock() calls to avoid memleaks
2017-08-25 23:48:18 +02:00
Standa Opichal
f0b9396997 New dgramSocket.send(msg, ...), .bind(port)
The send() method contains the destination host/port which is
put into the connection.opt (options) structure and later used
for the sendto() within net->send() call (network_linux).
2017-08-25 23:48:18 +02:00
Standa Opichal
df54f21935 Introduced SocketType ST_UDP
Initial attempt only, able to send UDP data using socket.write().
2017-08-25 23:48:18 +02:00
Standa Opichal
bb13604e6b Added SocketType argument to net->createsocket() method. 2017-06-23 22:51:56 +02:00
kolban
565285410b Initial files for the ESP32 environment. 2016-10-09 22:53:20 -05:00
Gordon Williams
34326d03b9 Allow different types of network to have different buffer sizes - enlarge JS, Linux and WIZnet buffers 2016-01-15 18:37:54 +00:00
Volodymyr Shymanskyy
4164371ede Fix for compiling with musl library (for OpenWrt) 2015-09-29 13:35:00 +03:00
Gordon Williams
a11edb58f9 more warning removal 2015-06-01 18:13:14 +01:00
Gordon Williams
f4584e7a22 esp8266 request now working 2015-01-13 18:34:47 +00:00
Gordon Williams
ead8497a7c squish warning 2014-05-02 09:08:42 +01:00
Ray Bellis
f9cc458f7e close the socket and return -1 if the socket connect call fails 2014-05-02 00:33:45 +01:00
Ray Bellis
15c9d92eb3 Get network_linux.c to build under MacOS X 2014-05-02 00:27:59 +01:00
Gordon Williams
713838976e Epic networking refactor - it should now be possible to support multiple network devices in a single binary 2014-03-06 15:44:03 +00:00