NetworkRequest.h revision 89b4e98a
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
17class BNetworkRequest: public BUrlRequest
18{
19public:
20								BNetworkRequest(const BUrl& url,
21									BUrlProtocolListener* listener,
22									BUrlContext* context,
23									const char* threadName,
24									const char* protocolName);
25
26	virtual	status_t			Stop();
27
28protected:
29			bool 				_ResolveHostName(uint16_t port);
30
31			void				_ProtocolSetup();
32			status_t			_GetLine(BString& destString);
33
34protected:
35			BAbstractSocket*	fSocket;
36			BNetworkAddress		fRemoteAddr;
37
38			BNetBuffer			fInputBuffer;
39};
40
41
42#endif
43