Tweak send/receive visibility
This commit is contained in:
parent
12f1d7b0ce
commit
81118e6606
@ -315,6 +315,29 @@ namespace fr
|
|||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Overridable send, to allow
|
||||||
|
* custom types to be directly sent through
|
||||||
|
* sockets.
|
||||||
|
*
|
||||||
|
* @param socket The socket to send through
|
||||||
|
* @return Status indicating if the send succeeded or not.
|
||||||
|
*/
|
||||||
|
Socket::Status send(Socket *socket) const override;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Overrideable receive, to allow
|
||||||
|
* custom types to be directly received through
|
||||||
|
* sockets.
|
||||||
|
*
|
||||||
|
* @param socket The socket to send through
|
||||||
|
* @return Status indicating if the send succeeded or not:
|
||||||
|
* 'Success': All good, object still valid.
|
||||||
|
* 'WouldBlock' or 'Timeout': No data received. Object still valid though.
|
||||||
|
* Anything else: Object invalid. Call disconnect().
|
||||||
|
*/
|
||||||
|
Socket::Status receive(Socket *socket) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/*!
|
/*!
|
||||||
* Splits a string by new line. Ignores escaped \n's
|
* Splits a string by new line. Ignores escaped \n's
|
||||||
@ -340,28 +363,7 @@ namespace fr
|
|||||||
*/
|
*/
|
||||||
void parse_header_line(const std::string &str);
|
void parse_header_line(const std::string &str);
|
||||||
|
|
||||||
/*!
|
|
||||||
* Overridable send, to allow
|
|
||||||
* custom types to be directly sent through
|
|
||||||
* sockets.
|
|
||||||
*
|
|
||||||
* @param socket The socket to send through
|
|
||||||
* @return Status indicating if the send succeeded or not.
|
|
||||||
*/
|
|
||||||
Socket::Status send(Socket *socket) const override;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* Overrideable receive, to allow
|
|
||||||
* custom types to be directly received through
|
|
||||||
* sockets.
|
|
||||||
*
|
|
||||||
* @param socket The socket to send through
|
|
||||||
* @return Status indicating if the send succeeded or not:
|
|
||||||
* 'Success': All good, object still valid.
|
|
||||||
* 'WouldBlock' or 'Timeout': No data received. Object still valid though.
|
|
||||||
* Anything else: Object invalid. Call disconnect().
|
|
||||||
*/
|
|
||||||
Socket::Status receive(Socket *socket) override;
|
|
||||||
|
|
||||||
//Other request info
|
//Other request info
|
||||||
std::unordered_map<std::string, std::string> header_data;
|
std::unordered_map<std::string, std::string> header_data;
|
||||||
|
|||||||
@ -690,9 +690,6 @@ namespace fr
|
|||||||
return buffer.size() <= PACKET_HEADER_LENGTH ? 0 : buffer.size() - PACKET_HEADER_LENGTH;
|
return buffer.size() <= PACKET_HEADER_LENGTH ? 0 : buffer.size() - PACKET_HEADER_LENGTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
|
||||||
friend class Socket;
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Overridable send, to allow
|
* Overridable send, to allow
|
||||||
* custom types to be directly sent through
|
* custom types to be directly sent through
|
||||||
@ -752,6 +749,9 @@ namespace fr
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
friend class Socket;
|
||||||
|
|
||||||
|
|
||||||
mutable std::string buffer; //Packet data buffer
|
mutable std::string buffer; //Packet data buffer
|
||||||
size_t buffer_read_index; //Current read position
|
size_t buffer_read_index; //Current read position
|
||||||
|
|||||||
@ -94,7 +94,6 @@ namespace fr
|
|||||||
final = is_final;
|
final = is_final;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
|
||||||
/*!
|
/*!
|
||||||
* Overridable send, to allow
|
* Overridable send, to allow
|
||||||
* custom types to be directly sent through
|
* custom types to be directly sent through
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user