capricorn one
Well-known member
Hi there, have a few questions the UDP side of the Ethernet library. I need to send data using UDP messages to multiple IP addresses, but not the same data to each. The data doesn't have to be sent at the same time, but it does need to go out fast. The problem I'm running into is a delay between sending messages when using the same socket, or running out of sockets if I create multiple objects. I have about 6 devices that I'll be sending data to (not receiving, just sending), but after the fourth socket the program seizes up. Some hardware things, I'm using a teensy 3.1, with an audio shield, and the WIZ820io ethernet module (which uses the W5200 chip). So here's my list of questions.
1. How many sockets are used when creating a EthernetUDP obect, 1 or 2? I don't know enough about this stuff, but it seems like if you had a listening port and a sending port you would need two sockets?
2. If the answer above is 1, does the current Ethernet library not support the 8 sockets available on the W5200 chip? (In the W5100.h file, MAX_SOCK_NUM is defined as 4, I don't see where that changes to 8 for W5200.
3. Really, my main question which would resolve having to create so many UDP objects, why is there a long delay when sending messages from the same socket to different IP addresses? If I use two sockets, and have each one send to different IP addresses, I get no delay. But if I change the destination IP when creating the new packet, it hangs every time. Is this a problem with the library? Or the chip? Or is this unavoidable..
Sorry for the long post, thanks in advance anyone that can help me out!
1. How many sockets are used when creating a EthernetUDP obect, 1 or 2? I don't know enough about this stuff, but it seems like if you had a listening port and a sending port you would need two sockets?
2. If the answer above is 1, does the current Ethernet library not support the 8 sockets available on the W5200 chip? (In the W5100.h file, MAX_SOCK_NUM is defined as 4, I don't see where that changes to 8 for W5200.
3. Really, my main question which would resolve having to create so many UDP objects, why is there a long delay when sending messages from the same socket to different IP addresses? If I use two sockets, and have each one send to different IP addresses, I get no delay. But if I change the destination IP when creating the new packet, it hangs every time. Is this a problem with the library? Or the chip? Or is this unavoidable..
Sorry for the long post, thanks in advance anyone that can help me out!