00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef CEYLAN_CLIENT_STREAM_SOCKET_H_
00028 #define CEYLAN_CLIENT_STREAM_SOCKET_H_
00029
00030
00031 #include "CeylanStreamSocket.h"
00032
00033 #include <string>
00034
00035
00036
00037
00038 namespace Ceylan
00039 {
00040
00041
00042 namespace Network
00043 {
00044
00045
00046
00048 class HostDNSEntry ;
00049
00050
00051
00064 class CEYLAN_DLL ClientStreamSocket: public StreamSocket
00065 {
00066
00067
00068 public:
00069
00070
00071
00077 class CEYLAN_DLL ClientStreamSocketException:
00078 public StreamSocketException
00079 {
00080
00081 public:
00082
00083 explicit ClientStreamSocketException(
00084 const std::string & reason ) ;
00085
00086 virtual ~ClientStreamSocketException() throw() ;
00087
00088 } ;
00089
00090
00091
00092
00099 ClientStreamSocket() ;
00100
00101
00102
00104 virtual ~ClientStreamSocket() throw() ;
00105
00106
00107
00113 virtual bool isConnected() const ;
00114
00115
00116
00144 virtual void connect( const std::string & serverHostname,
00145 Port serverPort ) ;
00146
00147
00148
00159 virtual void disconnect() ;
00160
00161
00162
00171 virtual Port getPeerPort() const ;
00172
00173
00174
00187 virtual const std::string toString(
00188 Ceylan::VerbosityLevels level = Ceylan::high ) const ;
00189
00190
00191
00192
00193 protected:
00194
00195
00196
00210 virtual void connected() ;
00211
00212
00214 const std::string & getServerName() const ;
00215
00216
00217
00218
00219 private:
00220
00221
00222
00224 std::string _serverHostName ;
00225
00226
00234 HostDNSEntry * _serverHostInfo ;
00235
00236
00237
00246 ClientStreamSocket( const ClientStreamSocket & source ) ;
00247
00248
00249
00258 ClientStreamSocket & operator = (
00259 const ClientStreamSocket & source ) ;
00260
00261
00262 } ;
00263
00264
00265 }
00266
00267 }
00268
00269
00270
00271 #endif // CEYLAN_CLIENT_STREAM_SOCKET_H_
00272