2014-08-04 17:59:53 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2014 Haiku Inc. All rights reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _B_NET_REQUEST_H_
|
|
|
|
#define _B_NET_REQUEST_H_
|
|
|
|
|
|
|
|
|
|
|
|
#include <NetBuffer.h>
|
|
|
|
#include <NetworkAddress.h>
|
|
|
|
#include <UrlRequest.h>
|
|
|
|
|
|
|
|
|
|
|
|
class BAbstractSocket;
|
|
|
|
|
|
|
|
|
2021-01-22 17:20:19 +03:00
|
|
|
namespace BPrivate {
|
|
|
|
|
|
|
|
namespace Network {
|
2021-09-11 10:09:44 +03:00
|
|
|
|
2021-01-22 17:20:19 +03:00
|
|
|
|
2014-08-04 17:59:53 +04:00
|
|
|
class BNetworkRequest: public BUrlRequest
|
|
|
|
{
|
|
|
|
public:
|
2020-07-25 07:45:42 +03:00
|
|
|
BNetworkRequest(const BUrl& url,
|
|
|
|
BDataIO* output,
|
|
|
|
BUrlProtocolListener* listener,
|
|
|
|
BUrlContext* context,
|
|
|
|
const char* threadName,
|
|
|
|
const char* protocolName);
|
2014-08-04 18:25:48 +04:00
|
|
|
|
|
|
|
virtual status_t Stop();
|
2014-09-26 17:51:36 +04:00
|
|
|
virtual void SetTimeout(bigtime_t timeout);
|
2014-08-04 18:25:48 +04:00
|
|
|
|
2014-08-04 17:59:53 +04:00
|
|
|
protected:
|
2014-09-15 16:24:37 +04:00
|
|
|
bool _ResolveHostName(BString host, uint16_t port);
|
2014-08-04 17:59:53 +04:00
|
|
|
|
2014-08-04 18:25:48 +04:00
|
|
|
void _ProtocolSetup();
|
2014-08-04 17:59:53 +04:00
|
|
|
status_t _GetLine(BString& destString);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
BAbstractSocket* fSocket;
|
|
|
|
BNetworkAddress fRemoteAddr;
|
|
|
|
|
|
|
|
BNetBuffer fInputBuffer;
|
|
|
|
};
|
|
|
|
|
2021-09-11 10:09:44 +03:00
|
|
|
|
2021-01-22 17:20:19 +03:00
|
|
|
} // namespace Network
|
|
|
|
|
|
|
|
} // namespace BPrivate
|
2014-08-04 17:59:53 +04:00
|
|
|
|
|
|
|
#endif
|