diff options
Diffstat (limited to 'Ivy/BufferedSocket.h')
-rw-r--r-- | Ivy/BufferedSocket.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Ivy/BufferedSocket.h b/Ivy/BufferedSocket.h new file mode 100644 index 0000000..851ead1 --- /dev/null +++ b/Ivy/BufferedSocket.h @@ -0,0 +1,36 @@ +// BufferedSocket.h: interface for the CBufferedSocket class.
+//
+//////////////////////////////////////////////////////////////////////
+
+
+#pragma once
+
+
+#include "ThreadedSocket.h"
+
+class CBufferedSocket : public CThreadedSocket
+{
+// DECLARE_DYNAMIC(CBufferedSocket)
+public:
+ CBufferedSocket();
+ virtual ~CBufferedSocket();
+ void OnReceive( int nErrorCode );
+ void OnSend( int nErrorCode );
+ void OnConnect(int nErrorCode);
+ virtual void OnReceive( char *line );
+ virtual void Accept(CBufferedSocket& rConnectedSocket,
+ SOCKADDR* lpSockAddr = NULL, int* lpSockAddrLen = NULL);
+ void SetSeparator( char sep );
+ void Send ( const char * data );
+protected:
+ bool connected; /* wait to be connected before sending any Data */
+ int separator;
+ /* buffer de reception de l'application */
+ long buffer_size;
+ char *buffer;
+ char *current_ptr;
+ // Buffer Emission
+ CRITICAL_SECTION m_CritSection;
+ ivy::list<ivy::string> buf_out;
+};
+
|