1/*
2 * Copyright 2014 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef _B_NET_REQUEST_H_
6#define _B_NET_REQUEST_H_
7
8
9#include <NetBuffer.h>
10#include <NetworkAddress.h>
11#include <UrlRequest.h>
12
13
14class BAbstractSocket;
15
16
17namespace BPrivate {
18
19namespace Network {
20
21
22class BNetworkRequest: public BUrlRequest
23{
24public:
25								BNetworkRequest(const BUrl& url,
26									BDataIO* output,
27									BUrlProtocolListener* listener,
28									BUrlContext* context,
29									const char* threadName,
30									const char* protocolName);
31
32	virtual	status_t			Stop();
33	virtual void				SetTimeout(bigtime_t timeout);
34
35protected:
36			bool 				_ResolveHostName(BString host, uint16_t port);
37
38			void				_ProtocolSetup();
39			status_t			_GetLine(BString& destString);
40
41protected:
42			BAbstractSocket*	fSocket;
43			BNetworkAddress		fRemoteAddr;
44
45			BNetBuffer			fInputBuffer;
46};
47
48
49} // namespace Network
50
51} // namespace BPrivate
52
53#endif
54