Go to the documentation of this file.00001 #ifndef QRK_TCPIP_SOCKET_H
00002 #define QRK_TCPIP_SOCKET_H
00003
00013 #include "Connection.h"
00014 #include <string>
00015 #include <memory>
00016
00017
00018 namespace qrk
00019 {
00020 class SocketSet;
00021
00022
00024 class TcpipSocket : public Connection
00025 {
00026 public:
00027 TcpipSocket(void);
00028
00029
00035 TcpipSocket(void* socket);
00036
00037
00044 TcpipSocket(SocketSet* socket_set, void* socket = NULL);
00045
00046 ~TcpipSocket(void);
00047
00048 const char* what(void) const;
00049
00050 bool connect(const char* host, long port);
00051 void disconnect(void);
00052 bool setBaudrate(long baudrate);
00053 long baudrate(void) const;
00054 bool isConnected(void) const;
00055 int send(const char* data, size_t count);
00056 int receive(char* data, size_t count, int timeout);
00057 size_t size(void) const;
00058 void flush(void);
00059 void clear(void);
00060 void ungetc(const char ch);
00061
00062 private:
00063 TcpipSocket(const TcpipSocket& rhs);
00064 TcpipSocket& operator = (const TcpipSocket& rhs);
00065
00066 struct pImpl;
00067 const std::auto_ptr<pImpl> pimpl;
00068 };
00069 }
00070
00071 #endif