SimpleSocket 1.0 examples

Dependencies:   EthernetNetIf SimpleSocket 1.0 mbed

Committer:
yamaguch
Date:
Mon Oct 03 06:47:44 2011 +0000
Revision:
26:6f42de9d8ed8
Parent:
25:b3ab82301345
Child:
32:00114e36de90
added ClientSocket::scanf() and ClientSocket::getAddr()

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yamaguch 1:7350a2598a80 1 #include "mbed.h"
yamaguch 1:7350a2598a80 2 #include "EthernetNetIf.h"
yamaguch 4:59056313fbfa 3 #include "SimpleSocket.h"
yamaguch 2:304672a01127 4
yamaguch 26:6f42de9d8ed8 5 void scanftest(int port);
yamaguch 8:b35559c14d17 6 void echoserver(int port);
yamaguch 22:fc886208c19b 7 void echoserver2(int port);
yamaguch 10:62ce72ee3e91 8 void echoclient(char *server, int port, char *message);
yamaguch 8:b35559c14d17 9 void httpclient(char *url);
yamaguch 17:50c0e9c5ca79 10 void relayserver(int port, char *target, int targetport);
yamaguch 1:7350a2598a80 11
yamaguch 1:7350a2598a80 12 int main() {
yamaguch 4:59056313fbfa 13 EthernetNetIf eth;
yamaguch 4:59056313fbfa 14 EthernetErr ethErr = eth.setup();
yamaguch 4:59056313fbfa 15 if (ethErr) error("Error %d in setup.\n", ethErr);
yamaguch 2:304672a01127 16
yamaguch 26:6f42de9d8ed8 17 scanftest(7777);
yamaguch 24:9c7a2e830ef6 18 //echoserver(7777);
yamaguch 26:6f42de9d8ed8 19 //echoserver2(7777);
yamaguch 17:50c0e9c5ca79 20 //echoclient("10.0.3.17", 7777, "Hello world\n");
yamaguch 25:b3ab82301345 21 //httpclient("http://www.senio.co.jp/index.html");
yamaguch 21:a3cf1f055a4d 22 //relayserver(8888, "10.0.3.17", 1234);
yamaguch 0:c41b68a4a296 23 }