00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00024 #ifndef SOCKETS_TCPSOCKET_H
00025 #define SOCKETS_TCPSOCKET_H
00026
00027
00028
00029 #include <sockets/tcpclient.h>
00030
00031
00032
00033 namespace sockets
00034 {
00035
00036
00037
00039
00041 class TCPSocket : public TCPClient
00042 {
00043 public:
00045
00052 explicit TCPSocket(Buffer *rbuf = 0, Buffer *wbuf = 0) :
00053 TCPClient(rbuf, wbuf), m_next(0) { }
00055 TCPSocket(TCPSocket const &tcps) : TCPClient(tcps), m_next(0) { }
00057 TCPSocket &operator=(TCPSocket const &right);
00058
00060
00079 virtual bool connect();
00080
00082
00101 virtual bool connect_next();
00102
00104 virtual bool set_remote(char const *address, char const *port,
00105 char const **error = 0);
00107 virtual bool set_remote(char const *address, unsigned short port,
00108 char const **error = 0)
00109 { return TCPClient::set_remote(address, port, error); }
00110
00112
00130 virtual bool add_remote(char const *address, char const *port,
00131 char const **error = 0);
00132
00134 virtual char const *raddress() const;
00135
00137 virtual unsigned short rport() const;
00138
00140 virtual bool is_last() const
00141 { return ((m_next && !m_next->next()) ? true : false); }
00142 protected:
00144 virtual bool connect(IPInfo const *ipi);
00145
00147 IPInfo const *next() const { return m_next; }
00148 private:
00149 IPInfo const *m_next;
00150 };
00151
00152
00153
00154 }
00155
00156
00157
00158 #endif