1// Sun, 18 Jun 2000
2// Y.Takagi
3
4#ifndef __LPSCLIENT_H
5#define __LPSCLIENT_H
6
7#include <iostream>
8#include <string>
9
10
11using namespace std;
12
13
14class Socket;
15
16
17class LPSException {
18public:
19					LPSException(const string& what)
20						:
21						fWhat(what)
22					{
23					}
24
25	const char *	what() const
26					{
27						return fWhat.c_str();
28					}
29
30private:
31	string fWhat;
32
33};
34
35
36class LpsClient {
37public:
38					LpsClient(const char* host);
39					~LpsClient();
40	void			connect();
41	void			close();
42	void			receiveJob(const char* queue);
43	void			receiveControlFile(int cfsize, const char* cfname);
44	void			receiveDataFile(int dfsize, const char* dfname);
45	void			transferData(const char* buffer, int size = -1);
46	void			transferData(istream& is, int size = -1);
47	void			endTransfer();
48	void			checkAck();
49
50private:
51	bool		fConnected;
52	string  	fHost;
53	Socket* 	fSock;
54	istream*	fInput;
55	ostream*	fOutput;
56};
57
58
59#endif	/* __LPSCLIENT_H */
60