A version of LWIP, provided for backwards compatibility.

Dependents:   AA_DemoBoard DemoBoard HelloServerDemo DemoBoard_RangeIndicator ... more

Committer:
root@mbed.org
Date:
Tue May 08 15:32:10 2012 +0100
Revision:
0:5e1631496985
initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
root@mbed.org 0:5e1631496985 1 #ifndef TCPLISTENER_H
root@mbed.org 0:5e1631496985 2 #define TCPLISTENER_H
root@mbed.org 0:5e1631496985 3
root@mbed.org 0:5e1631496985 4 #include "tcpitem.h"
root@mbed.org 0:5e1631496985 5
root@mbed.org 0:5e1631496985 6 #include "arch/cc.h"
root@mbed.org 0:5e1631496985 7 #include "lwip/err.h"
root@mbed.org 0:5e1631496985 8 #include "lwip/tcp.h"
root@mbed.org 0:5e1631496985 9
root@mbed.org 0:5e1631496985 10 namespace mbed {
root@mbed.org 0:5e1631496985 11 class NetServer;
root@mbed.org 0:5e1631496985 12
root@mbed.org 0:5e1631496985 13 class TCPListener : public TCPItem {
root@mbed.org 0:5e1631496985 14 public:
root@mbed.org 0:5e1631496985 15 TCPListener(u16_t port) : _port(port) {
root@mbed.org 0:5e1631496985 16 _pcb = tcp_new();
root@mbed.org 0:5e1631496985 17 tcp_arg(this->_pcb, static_cast<void *>(this));
root@mbed.org 0:5e1631496985 18 }
root@mbed.org 0:5e1631496985 19
root@mbed.org 0:5e1631496985 20 /**
root@mbed.org 0:5e1631496985 21 * Function to call when a listener has been connected.
root@mbed.org 0:5e1631496985 22 * @param err an error argument (TODO: that is current always ERR_OK?)
root@mbed.org 0:5e1631496985 23 * @return ERR_OK: accept the new connection,
root@mbed.org 0:5e1631496985 24 * any other err_t abortsthe new connection
root@mbed.org 0:5e1631496985 25 */
root@mbed.org 0:5e1631496985 26 virtual err_t accept(struct tcp_pcb *, err_t err) = 0;
root@mbed.org 0:5e1631496985 27 private:
root@mbed.org 0:5e1631496985 28 void bind();
root@mbed.org 0:5e1631496985 29
root@mbed.org 0:5e1631496985 30 u16_t _port;
root@mbed.org 0:5e1631496985 31 friend NetServer;
root@mbed.org 0:5e1631496985 32 };
root@mbed.org 0:5e1631496985 33
root@mbed.org 0:5e1631496985 34 };
root@mbed.org 0:5e1631496985 35
root@mbed.org 0:5e1631496985 36 #endif /* TCPLISTENER_H */