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
00103 virtual bool connect_next(bool *last = 0);
00104
00106 virtual bool set_remote(char const *address, char const *port,
00107 char const **error = 0);
00109 virtual bool set_remote(char const *address, unsigned short port,
00110 char const **error = 0)
00111 { return TCPClient::set_remote(address, port, error); }
00112
00114
00132 virtual bool add_remote(char const *address, char const *port,
00133 char const **error = 0);
00134
00136 virtual char const *raddress() const;
00137
00139 virtual unsigned short rport() const;
00140 protected:
00142 virtual bool connect(IPInfo const *ipi);
00143
00145 IPInfo const *next() const { return m_next; }
00146 private:
00147 IPInfo const *m_next;
00148 };
00149
00150
00151
00152 }
00153
00154
00155
00156 #endif