Netduino home hardware projects downloads community

Jump to content

The Netduino forums have been replaced by new forums at This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

Anthony Glenwright

Member Since 25 Jun 2011
Offline Last Active Aug 03 2015 06:23 AM

Posts I've Made

In Topic: Introducing Netduino 3 Wi-Fi

06 May 2015 - 12:54 AM

On multicast: are you wanting to subscribe to multicast groups?


I've always wanted to make my device SSDP-discoverable.  In order to do that, I need to be able to join a multicast group, with code something like:

        Dim ipAddr As Byte() = localaddress.GetAddressBytes()
        Dim multicastOpt As Byte() = New Byte() {discoveryAddr(0), discoveryAddr(1), discoveryAddr(2), discoveryAddr(3), ipAddr(0), ipAddr(1), ipAddr(2), ipAddr(3)}

        mobjSearchListenerSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, True)
        mobjSearchListenerSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.MulticastInterface, True)

        mobjSearchListenerSocket.Bind(New IPEndPoint(IPAddress.Any, 1900))
        ' This line fails on Netduino 4.2 RC5
        mobjSearchListenerSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, multicastOpt)

So thats what I was asking about RE multicast.


My question on the number of sockets:  My use case is that the "client" software is web-based and uses web sockets.  So each connected (web socket) client would use up a socket pretty much permanently, and the web software is served up to the end user browser via a web server.  Modern browsers tend to open multiple connections at once for CSS/JS files, etc so I end up getting connection failures pretty easily.  So I am not after the ability to turn the Netduino into a web server exactly, but I do want to be able to successfully serve up the client software. 


I set the cache-control headers so that the files are only served up once - but I still need them to be served up on the initial request successfully.  And if you add a connection to a time server and an SSDP listener, theres another two sockets gone.  So with a total of 8 sockets, I lose 3 to SSDP/NTP/HTTP listener, then when my first client connects and opens a web socket, there's another one gone, leaving me with only 4 sockets.  Once a second client connects, theres another (web) socket gone, leaving me with 3, and most likely limiting me to one concurrent client at once, we web browser tend to open 3 or 4 connections. 


The reason that I am serving up the files from the Netduino is to avoid the need for internet connectivity, and to avoid the potential for XSS protection from throwing security exceptions on the browser side.


What's the reason for only 8 sockets?  Is it a memory limitation on the CC3100?

In Topic: Introducing Netduino 3 Wi-Fi

05 May 2015 - 11:31 PM


Netduino 3 Wi-Fi uses a special Netduino.IP hybrid networking stack


Will the new networking stack support multicast?  Will we have control over the max. number of open sockets?  Is the networking performance improved over that of the Plus 2?

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.