00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef _StreamSocket_H
00034 #define _StreamSocket_H
00035
00036 #include "Socket.h"
00037
00038
00039 #ifdef SOCKETS_NAMESPACE
00040 namespace SOCKETS_NAMESPACE {
00041 #endif
00042
00043
00046 class StreamSocket : public Socket
00047 {
00048 public:
00049 StreamSocket(ISocketHandler& );
00050 ~StreamSocket();
00051
00053 void SetConnecting(bool = true);
00054
00057 bool Connecting();
00058
00062 bool Ready();
00063
00066 void SetConnectTimeout(int x);
00067
00070 int GetConnectTimeout();
00071
00074 void SetFlushBeforeClose(bool = true);
00075
00078 bool GetFlushBeforeClose();
00079
00084 void SetConnectionRetry(int n);
00085
00087 int GetConnectionRetry();
00088
00090 void IncreaseConnectionRetries();
00091
00093 int GetConnectionRetries();
00094
00096 void ResetConnectionRetries();
00097
00102 virtual void SetLineProtocol(bool = true);
00103
00106 bool LineProtocol();
00107
00109 void SetShutdown(int);
00110
00112 int GetShutdown();
00113
00115 virtual int Protocol() = 0;
00116
00117 protected:
00118 StreamSocket(const StreamSocket& src) : Socket(src) {}
00119
00120 private:
00121 StreamSocket& operator=(const StreamSocket& ) { return *this; }
00122
00123 bool m_bConnecting;
00124 int m_connect_timeout;
00125 bool m_flush_before_close;
00126 int m_connection_retry;
00127 int m_retries;
00128 bool m_line_protocol;
00129 int m_shutdown;
00130 };
00131
00132
00133 #ifdef SOCKETS_NAMESPACE
00134 }
00135 #endif
00136
00137
00138 #endif // _StreamSocket_H
00139