Reference.ServerConstructor History

Hide minor edits - Show changes to markup

June 04, 2010, at 03:21 AM by Equipo Traduccion -
Changed lines 1-2 from:

Ethernet : Server class

to:

Ethernet : clase Server

Changed lines 5-22 from:

Description

Create a server that listens for incoming connections on the specified port.

Syntax

Server(port);

Parameters

port: the port to listen on (int)

Returns

None

Example

to:

Descripción

Crea un servidor que recibe conexiones entrantes en el puerto especificado.

Sintaxis

Server(puerto);

Parámetros

puerto: el puerto en el cual escuchar (int)

Devuelve

Nada

Ejemplo

Changed line 26 from:

// network configuration. gateway and subnet are optional.

to:

// configuración de red, el gateway (puerta de enlace) y la subnet son opcionales.

Changed line 32 from:

// telnet defaults to port 23

to:

// telnet utiliza por defecto en el puerto 23

Changed line 37 from:
  // initialize the ethernet device
to:
  // inicializa el dispositivo ethernet
Changed line 40 from:
  // start listening for clients
to:
  // comienza a recibir conexiones
September 02, 2008, at 10:35 PM by David A. Mellis -
Changed lines 1-4 from:

Ethernet

Server class

to:

Ethernet : Server class

September 02, 2008, at 10:34 PM by David A. Mellis -
Added lines 1-2:
September 02, 2008, at 10:24 PM by David A. Mellis -
September 02, 2008, at 10:23 PM by David A. Mellis -
Deleted lines 0-1:
September 02, 2008, at 10:23 PM by David A. Mellis -
Changed lines 1-2 from:

\\

to:
September 02, 2008, at 10:22 PM by David A. Mellis -
Changed line 1 from:
to:

\\

September 02, 2008, at 10:22 PM by David A. Mellis -
Added line 1:
September 02, 2008, at 10:22 PM by David A. Mellis -
Added lines 1-52:

Server class

Server()

Description

Create a server that listens for incoming connections on the specified port.

Syntax

Server(port);

Parameters

port: the port to listen on (int)

Returns

None

Example

#include <Ethernet.h>

// network configuration.  gateway and subnet are optional.
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 10, 0, 0, 177 };
byte gateway[] = { 10, 0, 0, 1 };
byte subnet[] = { 255, 255, 0, 0 };

// telnet defaults to port 23
Server server = Server(23);

void setup()
{
  // initialize the ethernet device
  Ethernet.begin(mac, ip, gateway, subnet);

  // start listening for clients
  server.begin();
}

void loop()
{
  Client client = server.available();
  if (client) {
    server.write(client.read());
  }
}

Share