SimpleSocket 1.0 examples

Dependencies:   EthernetNetIf SimpleSocket 1.0 mbed

main.cpp

Committer:
yamaguch
Date:
2011-08-19
Revision:
15:ae9aff693b07
Parent:
13:1adb19edf716
Child:
17:50c0e9c5ca79

File content as of revision 15:ae9aff693b07:

#include "mbed.h"
#include "EthernetNetIf.h"
#include "SimpleSocket.h"

void echoserver(int port);
void echoclient(char *server, int port, char *message);
void httpclient(char *url);
void proxyserver(int port, char *target, int targetport);

int main() {
    EthernetNetIf eth;
    EthernetErr ethErr = eth.setup();
    if (ethErr) error("Error %d in setup.\n", ethErr);

    //echoserver(7777);
    //echoclient("10.0.3.20", 7777, "Hello world\n");
    //httpclient("http://www.senio.co.jp/index.html");
    proxyserver(8888, "10.0.3.20", 7777);
}