SimpleSocket 1.0 examples

Dependencies:   EthernetNetIf SimpleSocket 1.0 mbed

main.cpp

Committer:
yamaguch
Date:
2011-08-18
Revision:
11:04c0acd7f510
Parent:
10:62ce72ee3e91
Child:
12:52170a866d4a

File content as of revision 11:04c0acd7f510:

#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 simpleclient(char *servername, int port);
void stationclient(char *request);

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://10.0.3.20:7777/index.html");
    //simpleclient("10.0.3.20", 7);
    //stationclient("DigitalIn 9");
}