Tutorial.ChatServer History

Hide minor edits - Show changes to markup

November 28, 2011, at 04:31 PM by Scott Fitzgerald -
Changed line 37 from:
to:
November 16, 2011, at 05:11 AM by Scott Fitzgerald -
Changed line 37 from:
to:
November 16, 2011, at 04:27 AM by Scott Fitzgerald -
Changed line 37 from:
to:
September 23, 2010, at 05:06 AM by Christian Cerrito -
Changed lines 43-44 from:
to:
September 17, 2010, at 04:32 PM by Tom Igoe -
Changed lines 50-51 from:
to:
August 16, 2010, at 03:19 PM by Tom Igoe -
August 15, 2010, at 02:51 PM by Tom Igoe -
August 15, 2010, at 02:51 PM by Tom Igoe -
Changed line 29 from:

Schematic

to:

Schematic

August 15, 2010, at 03:53 AM by Christian Cerrito -
Changed lines 6-7 from:

A simple server that distributes any incoming messages to all connected clients. To use, open a terminal window, telnet to your devices IP address, and type away. Any incoming text will be sent to all connected clients (including the one typing). Additionally, you will be able to see the clients input in your serial monitor as well.

to:

A simple server that distributes any incoming messages to all connected clients. To use, open a terminal window, telnet to your devices IP address, and type away. Any incoming text will be sent to all connected clients (including the one typing). Additionally, you will be able to see the client's input in your serial monitor as well.

August 15, 2010, at 03:52 AM by Christian Cerrito -
Changed lines 6-7 from:

A simple server that distributes any incoming messages to all connected clients. To use, telnet to your devices IP address and type. Any incoming text will be sent to all connected clients (including the one typing). Additionally, you will be able to see the clients input in your serial monitor as well.

to:

A simple server that distributes any incoming messages to all connected clients. To use, open a terminal window, telnet to your devices IP address, and type away. Any incoming text will be sent to all connected clients (including the one typing). Additionally, you will be able to see the clients input in your serial monitor as well.

Changed line 34 from:

Describe what's going on here

to:

Code:

August 15, 2010, at 03:49 AM by Christian Cerrito -
Changed lines 6-7 from:

A simple server that distributes any incoming messages to all connected clients. To use telnet to 10.0.0.177 and type! Any incoming text will be sent to all connected clients (including the one typing).

to:

A simple server that distributes any incoming messages to all connected clients. To use, telnet to your devices IP address and type. Any incoming text will be sent to all connected clients (including the one typing). Additionally, you will be able to see the clients input in your serial monitor as well.

August 15, 2010, at 03:36 AM by Christian Cerrito -
Changed lines 25-26 from:

In the above image, the Arduino would be connected below the Ethernet shield.

to:

In the above image, the Arduino would be stacked below the Ethernet shield.

August 15, 2010, at 01:39 AM by Christian Cerrito -
Changed lines 25-26 from:

'In the above image, the Arduino would be connected below the Ethernet shield.''

to:

In the above image, the Arduino would be connected below the Ethernet shield.

August 15, 2010, at 01:38 AM by Christian Cerrito -
August 14, 2010, at 10:02 PM by Christian Cerrito -
Added lines 25-26:

'In the above image, the Arduino would be connected below the Ethernet shield.''

August 13, 2010, at 03:41 PM by Tom Igoe -
August 13, 2010, at 03:37 PM by Tom Igoe -
Changed lines 3-4 from:

Chat Server

to:

Chat Server

Changed lines 8-45 from:

Circuit

An Arduino board with a Arduino Ethernet Shield. The shield should be connected to a network with an ethernet cable. You will need to change the network settings in the program to correspond to your network.

Code

#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(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());
  }
}

See also

to:
Added lines 11-41:
August 13, 2010, at 03:35 PM by Tom Igoe -
Changed lines 47-53 from:
to:
November 01, 2008, at 02:42 PM by David A. Mellis -
Added lines 1-47:

Examples > Ethernet Library

Chat Server

A simple server that distributes any incoming messages to all connected clients. To use telnet to 10.0.0.177 and type! Any incoming text will be sent to all connected clients (including the one typing).

Circuit

An Arduino board with a Arduino Ethernet Shield. The shield should be connected to a network with an ethernet cable. You will need to change the network settings in the program to correspond to your network.

Code

#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(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());
  }
}

See also

Share