processConnection()

Description

Check for an incoming connection, and, if it exists, process it by reading its request and calling the appropriate command handler. This should be called continously in the loop() function of your sketch.

There are two version of this method: If called without any parameters then a URL buffer of 32 bytes is allocated internally. The version with parameters is the recommended method. – If you use URL parameters (i.e. forms using method GET) please make sure you leave enough room for any long strings your users might enter!

Syntax

webserver.processConnection();
webserver.processConnection(buff, bufflen);

Parameters

buff
URL buffer (array of char, any size); if called without parameters 32 bytes are allocated internally
bufflen
provide the length of your URL buffer (int)

Returns

None

Examples

#include "WebServer.h"
WebServer webserver; // defaults to no prefix, port 80

void setup() {
  // Ethernet stuff here, e.g. set MAC and IP address
  webserver.begin();
}

void loop() {
  char buff[64];
  int len = 64;

  webserver.processConnection(buff, &len);
}

« back to Webduino

Reply

Your email address will not be published.