For a question in forum this is a working example, there will be the example that is not working

Dependencies:   mbed

Fork of eth_v13 by Heiko Greiner

TCPSocket.h

Committer:
hggerdd
Date:
2014-03-18
Revision:
2:8f5bacfef390
Child:
3:79dc3337d9da

File content as of revision 2:8f5bacfef390:

#ifndef TCPSOCKET_H
#define TCPSOCKET_H

#include "ipaddr.h"

class TCPSocket
{
    int _socket;
    int _port;
    void (*m_pCb)(void);

public:
    TCPSocket(int newSocket);

    void bind(int port);
    void listen();
    void close();
    int send(const char* buf, int len);
    int recv(char* buf, int len);
    void poll();
    void setOnEvent(void (*pMethod)(void));
};
#endif // MYUDPSOCKET_H