File tree Expand file tree Collapse file tree 1 file changed +22
-20
lines changed Expand file tree Collapse file tree 1 file changed +22
-20
lines changed Original file line number Diff line number Diff line change 2121
2222#include " sockfd.hpp"
2323
24- struct TCP_FD_Conn ;
2524struct TCP_FD_Listen ;
2625
26+ struct TCP_FD_Conn
27+ {
28+ TCP_FD_Conn (net::tcp::Connection_ptr c);
29+ ~TCP_FD_Conn () = default ;
30+
31+ void retrieve_buffer ();
32+ void set_default_read ();
33+
34+ ssize_t send (const void *, size_t , int fl);
35+ ssize_t recv (void *, size_t , int fl);
36+ int close ();
37+ int shutdown (int );
38+
39+ std::string to_string () const { return conn->to_string (); }
40+
41+ net::tcp::Connection_ptr conn;
42+ net::tcp::buffer_t buffer;
43+ size_t buf_offset;
44+ bool recv_disc = false ;
45+ };
46+
47+
2748class TCP_FD : public SockFD {
2849public:
2950 using id_t = int ;
@@ -68,25 +89,6 @@ class TCP_FD : public SockFD {
6889 friend struct TCP_FD_Listen ;
6990};
7091
71- struct TCP_FD_Conn
72- {
73- TCP_FD_Conn (net::tcp::Connection_ptr c);
74-
75- void retrieve_buffer ();
76- void set_default_read ();
77-
78- ssize_t send (const void *, size_t , int fl);
79- ssize_t recv (void *, size_t , int fl);
80- int close ();
81- int shutdown (int );
82-
83- std::string to_string () const { return conn->to_string (); }
84-
85- net::tcp::Connection_ptr conn;
86- net::tcp::buffer_t buffer;
87- size_t buf_offset;
88- bool recv_disc = false ;
89- };
9092
9193struct TCP_FD_Listen
9294{
You can’t perform that action at this time.
0 commit comments