source: Sophya/trunk/AddOn/TAcq/burawstream.h@ 3684

Last change on this file since 3684 was 3542, checked in by ansari, 17 years ago

Ajouts fichiers du repertoire Remote (Classes Socket, ServerSocker RawInOutSocketStream ...) et fichier README , Reza 23/10/2008

File size: 1.1 KB
RevLine 
[3542]1// This may look like C code, but it is really -*- C++ -*-
2
3#ifndef BUFFRAWSTREAM_H_SEEN
4#define BUFFRAWSTREAM_H_SEEN
5
6// Classe de flot brut sur socket - pour utilisation par les streams PPersist
7// R. Ansari LAL IN2P3/CNRS 11/2005
8
9#include "machdefs.h"
10#include "rawstream.h"
11
12
13namespace SOPHYA {
14
15// Input flow over a socket
16class RawInOutBuffStream : public RawInOutStream {
17public:
18 RawInOutBuffStream(const char * nom);
19 virtual ~RawInOutBuffStream();
20
21 // Lecture
22 virtual int_8 tellg();
23 virtual RawInOutStream& read(char* s, uint_8 n);
24 // Ecriture
25 virtual int_8 tellp();
26 virtual RawInOutStream& write(const char* s, uint_8 n);
27
28protected:
29 size_t CopyToSendBuffer(const char* s, size_t n);
30 size_t CopyFromRecvBuffer(char* s, size_t n);
31 void SendBuffer();
32 void ReceiveBuffer();
33
34 size_t Send(const char* s, size_t n);
35 size_t Receive(char* s, size_t n);
36
37 FILE * _fip;
38 struct SRWBuff { char* buff; size_t sz, cpos; };
39 SRWBuff _rdbuff;
40 SRWBuff _wrbuff;
41 size_t _totnwr;
42 size_t _totnrd;
43};
44
45
46} // namespace SOPHYA
47
48#endif
Note: See TracBrowser for help on using the repository browser.