Error in ethernet library UDP doc

There is an error in the ethernet library UDP section. The UDP.begin(localPort) call documentation shows there is no return value. That is not correct.

The UDP.begin(localPort) call returns 1 on success, and 0 if no socket is available.

This is from EthernetUdp.h

  virtual uint8_t begin(uint16_t);	// initialize, start listening on specified port. Returns 1 if successful, 0 if there are no sockets available to use

and this from EthernetUdp.cpp

/* Start EthernetUDP socket, listening at local port PORT */
uint8_t EthernetUDP::begin(uint16_t port) {
  if (_sock != MAX_SOCK_NUM)
    return 0;

  for (int i = 0; i < MAX_SOCK_NUM; i++) {
    uint8_t s = W5100.readSnSR(i);
    if (s == SnSR::CLOSED || s == SnSR::FIN_WAIT) {
      _sock = i;

  if (_sock == MAX_SOCK_NUM)
    return 0;

  _port = port;
  _remaining = 0;
  socket(_sock, SnMR::UDP, _port, 0);

  return 1;

An error report was sent to also.

These reference changes take a while now. After the webmaster reads the request, it is posted on github for review.

Still no change to the ethernet udp reference page.

Still no change to the ethernet udp reference page.

Corrections have to be reviewed and validated, cannot be applied "as is". This is the reason for which sometime those stay pending for a while.

The issue in object has been fixed.

Thanks to MadBob for getting that error changed! :slight_smile:

I know there is a procedure you must go through, but it seems to take a long time for error corrections that are obvious once the change request gets to Github. This was Arduino library code with an obvious error and solution.