peter brier / Mbed 2 deprecated laos_server_v1

Dependencies:   EthernetNetIf mbed SDFileSystem

Embed: (wiki syntax)

« Back to documentation index

LaosServer Class Reference

LaosServer Class Reference

Simple TCP/IP Server Create server based on config file. More...

#include <LaosServer.h>

Public Member Functions

 LaosServer (int port)
 Make new LaosServer object.
int read ()
 Read value.
void write (int i)
 Write Integer value.

Detailed Description

Simple TCP/IP Server Create server based on config file.

Example:

 LaosServer srv("config.txt");
 int i = srv.read();
 srv.write(i);

Definition at line 48 of file LaosServer.h.


Constructor & Destructor Documentation

LaosServer ( int  port )

Make new LaosServer object.

Open config file. Note: the file handle is kept open during the lifetime of this object. To close the file: destroy this ConfigFile object!

Parameters:
fileFilename of the configuration file.

Definition at line 33 of file LaosServer.cpp.


Member Function Documentation

int read (  )

Read value.

If socket is not open, this blocks

Returns:
integer value, read from socket

Definition at line 56 of file LaosServer.cpp.

void write ( int  i )

Write Integer value.

If socket is not open, or cannot write: block

Parameters:
iInteger
Returns:
"true" if the key is found "false" is key is not found (default value is returned)

Definition at line 71 of file LaosServer.cpp.