acl/app/wizard_demo/httpd_proxy/tcp_transfer.h

34 lines
529 B
C
Raw Normal View History

#pragma once
2019-03-14 15:24:11 +08:00
class tcp_transfer : public acl::fiber
2019-03-14 15:24:11 +08:00
{
public:
tcp_transfer(acl::socket_stream& in, acl::socket_stream& out, bool running);
~tcp_transfer(void);
2019-03-14 15:24:11 +08:00
void set_peer(tcp_transfer& peer);
2022-02-16 23:01:54 +08:00
void unset_peer(void);
2019-03-14 15:24:11 +08:00
void wait(void);
acl::socket_stream& get_input(void) const
{
return in_;
}
acl::socket_stream& get_output(void) const
{
return out_;
}
public:
2019-03-14 15:24:11 +08:00
// @override
void run(void);
private:
acl::fiber_tbox<int> box_;
acl::socket_stream& in_;
acl::socket_stream& out_;
tcp_transfer* peer_;
2019-03-14 15:24:11 +08:00
};