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;
|
|
|
|
|
|
|
|
|
|
|
|
class BNetworkRequest: public BUrlRequest
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
BNetworkRequest(const BUrl& url,
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|