Add host overwriting functionality to Socket::Connection.
This commit is contained in:
parent
689eb74945
commit
95a11c88d5
2 changed files with 7 additions and 0 deletions
|
@ -442,6 +442,12 @@ std::string Socket::Connection::getHost(){
|
|||
return remotehost;
|
||||
}
|
||||
|
||||
/// Sets hostname for connection manually.
|
||||
/// Overwrites the detected host, thus possibily making it incorrect.
|
||||
void setHost(std::string host){
|
||||
remotehost = host;
|
||||
}
|
||||
|
||||
/// Returns true if these sockets are the same socket.
|
||||
/// Does not check the internal stats - only the socket itself.
|
||||
bool Socket::Connection::operator== (const Connection &B) const{
|
||||
|
|
|
@ -54,6 +54,7 @@ namespace Socket{
|
|||
void Send(std::string data); ///< Appends data to the upbuffer.
|
||||
void close(); ///< Close connection.
|
||||
std::string getHost(); ///< Gets hostname for connection, if available.
|
||||
void setHost(std::string host); ///< Sets hostname for connection manually.
|
||||
int getSocket(); ///< Returns internal socket number.
|
||||
std::string getError(); ///< Returns a string describing the last error that occured.
|
||||
unsigned int dataUp(); ///< Returns total amount of bytes sent.
|
||||
|
|
Loading…
Add table
Reference in a new issue