tcp: Add APICall trace entry and move TRACEs into locked parts.
[haiku.git] / src / add-ons / print / transports / lpr / LpsClient.h
blob3a790e1efdb8a2d31136724eb81db2c663c1d433
1 // Sun, 18 Jun 2000
2 // Y.Takagi
4 #ifndef __LPSCLIENT_H
5 #define __LPSCLIENT_H
7 #include <iostream>
8 #include <string>
11 using namespace std;
14 class Socket;
17 class LPSException {
18 public:
19 LPSException(const string& what)
21 fWhat(what)
25 const char * what() const
27 return fWhat.c_str();
30 private:
31 string fWhat;
36 class LpsClient {
37 public:
38 LpsClient(const char* host);
39 ~LpsClient();
40 void connect() throw(LPSException);
41 void close();
42 void receiveJob(const char* queue) throw(LPSException);
43 void receiveControlFile(int cfsize, const char* cfname)
44 throw(LPSException);
45 void receiveDataFile(int dfsize, const char* dfname)
46 throw(LPSException);
47 void transferData(const char* buffer, int size = -1)
48 throw(LPSException);
49 void transferData(istream& is, int size = -1)
50 throw(LPSException);
51 void endTransfer() throw(LPSException);
52 void checkAck() throw(LPSException);
54 private:
55 bool fConnected;
56 string fHost;
57 Socket* fSock;
58 istream* fInput;
59 ostream* fOutput;
63 #endif /* __LPSCLIENT_H */