You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This effectively disallows setting of the size unless the size is zero. No idea who sets the initial value, but it isn't zero when I call setSocketSize, and so my call has no effect. I doubt that is what was intended, but please let me know if I am missing something here. I changed the code to this:
And now all is working fine for me. I think what you want here is something like (NOTE: I do not know where the actual max packet size is to be found. I just used a made up symbol MAX_MTU here...)
but it is never used. In any case, I think programs should be allowed to set the recv buf size up to the actual limit of the physical transport, whatever that might be...
The text was updated successfully, but these errors were encountered:
Code such as this silently fails to change the recv buf size, and incoming packets never arrive
// start UDP
Ethernet.setSocketSize(1620 * 3);
Udp.begin(T_PORT);
I looked at the code and found this:
void EthernetClass::setSocketSize(size_t _socket_size)
{
if(socket_size != 0) return;
socket_size = _socket_size;
}
This effectively disallows setting of the size unless the size is zero. No idea who sets the initial value, but it isn't zero when I call setSocketSize, and so my call has no effect. I doubt that is what was intended, but please let me know if I am missing something here. I changed the code to this:
void EthernetClass::setSocketSize(size_t _socket_size)
{
//if(socket_size != 0) return;
socket_size = _socket_size;
}
And now all is working fine for me. I think what you want here is something like (NOTE: I do not know where the actual max packet size is to be found. I just used a made up symbol MAX_MTU here...)
void EthernetClass::setSocketSize(size_t _socket_size)
{
if(_socket_size > MAX_MTU) _socket_size = MAX_MTU;
socket_size = _socket_size;
}
I found this:
#define UDP_TX_PACKET_MAX_SIZE 2048
but it is never used. In any case, I think programs should be allowed to set the recv buf size up to the actual limit of the physical transport, whatever that might be...
The text was updated successfully, but these errors were encountered: