source: trunk/MagicSoft/Mars/mbase/MReadSocket.h@ 3504

Last change on this file since 3504 was 2490, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 941 bytes
Line 
1#ifndef MARS_MReadSocket
2#define MARS_MReadSocket
3
4#ifndef ROOT_TROOT
5#include <TROOT.h>
6#endif
7#ifndef ROOT_TTime
8#include <TTime.h>
9#endif
10
11#include <iostream> // base classes for MReadSocket
12
13class TSocket;
14class TServerSocket;
15
16class MReadSocket : public std::streambuf, public std::istream
17{
18private:
19 char *fBuffer; //!
20
21 int fPort;
22 int fMtu;
23 TTime fTimeout;
24
25 TServerSocket *fServSock;
26 TSocket *fRxSocket;
27
28 void OpenServerSocket(int port);
29 void OpenConnection(Bool_t block);
30
31 int underflow();
32 int sync();
33
34public:
35 MReadSocket(int port=-1, int mtu=1500);
36 MReadSocket(MReadSocket const& log) : istream((std::streambuf*)&log)
37 {
38 }
39 ~MReadSocket();
40
41 Bool_t Open(int port=-1, Bool_t block=kFALSE);
42 void Close();
43
44 void SetTimeout(UInt_t millisec) { fTimeout = millisec; }
45
46 ClassDef(MReadSocket, 0) // This is what we call 'The logging system'
47};
48
49#endif
Note: See TracBrowser for help on using the repository browser.