W5200(WIZ820io) network interface

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MyNetTcpSocket.h Source File

MyNetTcpSocket.h

00001 // MyNetTcpSocket.h 2012/4/16
00002 #ifndef MYNETTCPSOCKET_H
00003 #define MYNETTCPSOCKET_H
00004 #include "if/net/nettcpsocket.h"
00005 
00006 class MyNetTcpSocket : public NetTcpSocket {
00007 public:
00008     MyNetTcpSocket(int socket = (-1));
00009     virtual ~MyNetTcpSocket();
00010     virtual NetTcpSocketErr bind(const Host& me);
00011     virtual NetTcpSocketErr listen();
00012     virtual NetTcpSocketErr connect(const Host& host);
00013     virtual NetTcpSocketErr accept(Host* pClient, NetTcpSocket** ppNewNetTcpSocket);
00014     virtual int /*if < 0 : NetTcpSocketErr*/ send(const char* buf, int len);
00015     virtual int /*if < 0 : NetTcpSocketErr*/ recv(char* buf, int len);
00016     virtual NetTcpSocketErr close();
00017     virtual NetTcpSocketErr poll();
00018 protected:
00019     int _socket;
00020     bool wait_accept;
00021 private:
00022     void cleanUp(); //Flush input buffer
00023     queue<MyNetTcpSocket*> m_lpInNetTcpSocket;
00024 };
00025 #endif //MYNETTCPSOCKET_H