15a1d355fSStephan Aßmus // RequestConnection.h 25a1d355fSStephan Aßmus 35a1d355fSStephan Aßmus #ifndef NET_FS_REQUEST_CONNECTION_H 45a1d355fSStephan Aßmus #define NET_FS_REQUEST_CONNECTION_H 55a1d355fSStephan Aßmus 65a1d355fSStephan Aßmus #include <SupportDefs.h> 75a1d355fSStephan Aßmus 85a1d355fSStephan Aßmus class Connection; 95a1d355fSStephan Aßmus class Request; 105a1d355fSStephan Aßmus class RequestHandler; 115a1d355fSStephan Aßmus 125a1d355fSStephan Aßmus class RequestConnection { 135a1d355fSStephan Aßmus public: 145a1d355fSStephan Aßmus RequestConnection(Connection* connection, 155a1d355fSStephan Aßmus RequestHandler* requestHandler, 165a1d355fSStephan Aßmus bool ownsRequestHandler = false); 175a1d355fSStephan Aßmus ~RequestConnection(); 185a1d355fSStephan Aßmus 195a1d355fSStephan Aßmus status_t Init(); 205a1d355fSStephan Aßmus 215a1d355fSStephan Aßmus void Close(); 225a1d355fSStephan Aßmus 235a1d355fSStephan Aßmus status_t SendRequest(Request* request, 245a1d355fSStephan Aßmus Request** reply = NULL); 255a1d355fSStephan Aßmus status_t SendRequest(Request* request, 265a1d355fSStephan Aßmus RequestHandler* replyHandler); 275a1d355fSStephan Aßmus private: 285a1d355fSStephan Aßmus class DownStreamThread; 295a1d355fSStephan Aßmus friend class DownStreamThread; 305a1d355fSStephan Aßmus 315a1d355fSStephan Aßmus private: 325a1d355fSStephan Aßmus bool DownStreamChannelError(DownStreamThread* thread, 335a1d355fSStephan Aßmus status_t error); 345a1d355fSStephan Aßmus 355a1d355fSStephan Aßmus status_t _SendRequest(Request* request, Request** reply, 365a1d355fSStephan Aßmus RequestHandler* replyHandler); 375a1d355fSStephan Aßmus 385a1d355fSStephan Aßmus private: 395a1d355fSStephan Aßmus Connection* fConnection; 405a1d355fSStephan Aßmus RequestHandler* fRequestHandler; 415a1d355fSStephan Aßmus bool fOwnsRequestHandler; 425a1d355fSStephan Aßmus DownStreamThread* fThreads; 435a1d355fSStephan Aßmus int32 fThreadCount; 44*f0d46bd8SAdrien Destugues int32 fTerminationCount; 455a1d355fSStephan Aßmus }; 465a1d355fSStephan Aßmus 475a1d355fSStephan Aßmus #endif // NET_FS_REQUEST_CONNECTION_H 48