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_STREAM_SOCKET_H_
00028 #define CEYLAN_STREAM_SOCKET_H_
00029
00030
00031 #include "CeylanSocket.h"
00032
00033 #include <string>
00034
00035
00036
00037 namespace Ceylan
00038 {
00039
00040
00041 namespace Network
00042 {
00043
00044
00045
00058 class CEYLAN_DLL StreamSocket: public Socket
00059 {
00060
00061
00062 public:
00063
00064
00065
00067 class CEYLAN_DLL StreamSocketException:
00068 public SocketException
00069 {
00070
00071 public:
00072
00073 explicit StreamSocketException(
00074 const std::string & reason ) ;
00075
00076 virtual ~StreamSocketException() throw() ;
00077
00078 } ;
00079
00080
00081
00105 explicit StreamSocket( bool blocking = true,
00106 bool sacrificeThroughputToPacketTiming = false ) ;
00107
00108
00109
00132 explicit StreamSocket( Port localPort, bool blocking = true,
00133 bool sacrificeThroughputToPacketTiming = false ) ;
00134
00135
00136
00138 virtual ~StreamSocket() throw() ;
00139
00140
00141
00153 virtual void setBlocking( bool newStatus ) ;
00154
00155
00156
00169 virtual const std::string toString(
00170 Ceylan::VerbosityLevels level = Ceylan::high ) const ;
00171
00172
00173
00174
00175 protected:
00176
00177
00185 virtual void createSocket( Port port ) ;
00186
00187
00188
00200 virtual void setNagleAlgorithmTo( bool activated ) ;
00201
00202
00203
00223 bool _nagleAlgorithmDeactivated ;
00224
00225
00226
00227
00228 private:
00229
00230
00239 StreamSocket( const StreamSocket & source ) ;
00240
00241
00250 StreamSocket & operator = ( const StreamSocket & source ) ;
00251
00252
00253 } ;
00254
00255
00256 }
00257
00258 }
00259
00260
00261
00262 #endif // CEYLAN_STREAM_SOCKET_H_
00263