a library to use GPRS like ethernet or wifi, which makes it possible to connect to the internet with your GPRS module

Dependents:   Seeed_GPRS_Library_HelloWorld Seeed_GPRS_Xively_HelloWorld Seeed_ARCH_GPRS_V2_Xively_HelloWorld Seeed_ARCH_GPRS_V2_ThingSpeak_HelloWorld ... more

Embed: (wiki syntax)

« Back to documentation index

TCPSocketServer Class Reference

TCPSocketServer Class Reference

TCP Server. More...

#include <TCPSocketServer.h>

Inherits Socket.

Public Member Functions

 TCPSocketServer ()
 Instantiate a TCP Server.
int bind (int port)
 Bind a socket to a specific port.
int listen (int backlog=1)
 Start listening for incoming connections.
int accept (TCPSocketConnection &connection)
 Accept a new connection.
int close ()
 Close the socket file descriptor.

Detailed Description

TCP Server.

Definition at line 30 of file TCPSocketServer.h.


Constructor & Destructor Documentation

Instantiate a TCP Server.


Member Function Documentation

int accept ( TCPSocketConnection connection )

Accept a new connection.

Parameters:
connectionA TCPSocketConnection instance that will handle the incoming connection.
Returns:
0 on success, -1 on failure.
int bind ( int  port )

Bind a socket to a specific port.

Parameters:
portThe port to listen for incoming connections on.
Returns:
0 on success, -1 on failure.
int close (  ) [inherited]

Close the socket file descriptor.

Definition at line 37 of file Socket.cpp.

int listen ( int  backlog = 1 )

Start listening for incoming connections.

Parameters:
backlognumber of pending connections that can be queued up at any one time [Default: 1].
Returns:
0 on success, -1 on failure.