diff options
author | fcolin | 2007-02-01 12:53:58 +0000 |
---|---|---|
committer | fcolin | 2007-02-01 12:53:58 +0000 |
commit | de40b495ce0bfaa6d9f7ebf8e828e43e23feca0c (patch) | |
tree | 897b8c440064984b745db01b7f592bf443c97d00 /Bus/Ivy/BufferedSocket.h | |
parent | 8ebf7e3d5a9161894cf99a5a38e59df2d7118a29 (diff) | |
download | ivy-cplusplus-de40b495ce0bfaa6d9f7ebf8e828e43e23feca0c.zip ivy-cplusplus-de40b495ce0bfaa6d9f7ebf8e828e43e23feca0c.tar.gz ivy-cplusplus-de40b495ce0bfaa6d9f7ebf8e828e43e23feca0c.tar.bz2 ivy-cplusplus-de40b495ce0bfaa6d9f7ebf8e828e43e23feca0c.tar.xz |
Utilisateur : Fcolin Date : 16/06/00 Heure : 10:14 Créé (vss 1)
Diffstat (limited to 'Bus/Ivy/BufferedSocket.h')
-rw-r--r-- | Bus/Ivy/BufferedSocket.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Bus/Ivy/BufferedSocket.h b/Bus/Ivy/BufferedSocket.h new file mode 100644 index 0000000..5f104c6 --- /dev/null +++ b/Bus/Ivy/BufferedSocket.h @@ -0,0 +1,42 @@ +// BufferedSocket.h: interface for the CBufferedSocket class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#if !defined(AFX_BUFFEREDSOCKET_H__ECAC808B_3B4D_11D3_8A1E_00A0245B298A__INCLUDED_)
+#define AFX_BUFFEREDSOCKET_H__ECAC808B_3B4D_11D3_8A1E_00A0245B298A__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#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);
+ void OnWakeup();
+ 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 */
+ char separator;
+ /* buffer de reception de l'application */
+#define MAX_BUFFER 2048
+ // MAX_BUFFER +1 pour ajouter \0 a la fin
+ char buf[MAX_BUFFER+1];
+ char *ptr;
+ // Buffer Emission
+ CRITICAL_SECTION m_CritSection;
+ list<string> buf_out;
+};
+
+#endif // !defined(AFX_BUFFEREDSOCKET_H__ECAC808B_3B4D_11D3_8A1E_00A0245B298A__INCLUDED_)
|