Non DHPC Echo Server

20 Jul 2010

Does anyone have example code of an echo server with fixed IP address ie set from within the code? It is many years since I

wrote any sockets code so a little help would be much appreciated.

Ps Mbed is fantastic so intuative.

John Knott

20 Jul 2010

This project should be what you need.

The DHCP/manually assigned IP address difference is just:

EthernetNetIf eth(
  IpAddr(192,168,1,158), //IP Address
  IpAddr(255,255,255,0), //Network Mask
  IpAddr(192,168,1,254), //Gateway
  IpAddr(192,168,1,2)  //DNS
);
Versus

EthernetNetIf eth;

20 Jul 2010

Many thanks

Builld now responds to ping on test address in 10.10.10  group.

The next problem is how to accept connections on any (or just  telnet port)

I presume I must bind to other than 7

is there a number for accept connections on any port?

 

void bind(int tcpPort=7, int udpPort=7);