Summerizing of stats in Buffer done - closes #2
This commit is contained in:
		
							parent
							
								
									ff4e2aa285
								
							
						
					
					
						commit
						2f5d5fcecb
					
				
					 2 changed files with 4 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -216,8 +216,9 @@ unsigned int Socket::Connection::dataDown(){
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
/// Returns a std::string of stats, ended by a newline.
 | 
			
		||||
std::string Socket::Connection::getStats(){
 | 
			
		||||
  return getHost() + uint2string(time(0) - conntime) + " " + uint2string(up) + uint2string(down) + "\n";
 | 
			
		||||
/// Requires the current connector name as an argument.
 | 
			
		||||
std::string Socket::Connection::getStats(std::string C){
 | 
			
		||||
  return getHost() + " " + C + " " + uint2string(time(0) - conntime) + " " + uint2string(up) + " " + uint2string(down) + "\n";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/// Writes data to socket. This function blocks if the socket is blocking and all data cannot be written right away.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -52,7 +52,7 @@ namespace Socket{
 | 
			
		|||
      std::string getError(); ///< Returns a string describing the last error that occured.
 | 
			
		||||
      unsigned int dataUp(); ///< Returns total amount of bytes sent.
 | 
			
		||||
      unsigned int dataDown(); ///< Returns total amount of bytes received.
 | 
			
		||||
      std::string getStats(); ///< Returns a std::string of stats, ended by a newline.
 | 
			
		||||
      std::string getStats(std::string C); ///< Returns a std::string of stats, ended by a newline.
 | 
			
		||||
      friend class Server;
 | 
			
		||||
      bool Error; ///< Set to true if a socket error happened.
 | 
			
		||||
      bool Blocking; ///< Set to true if a socket is currently or wants to be blocking.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue