virtual void write_to_socket(const std::string& data) = 0;
- virtual int close() = 0;
+ virtual void close() = 0;
};
#endif
* @param data Data to send
* @return 0 if all is fine, -1 on error.
*/
-int NetHelper::send_data(const std::string& data)
+int NetHelper::send_data(const std::string& data) const
{
try
{
* Receive all available data from the peer.
* @return The data received.
*/
-std::string NetHelper::receive_data()
+std::string NetHelper::receive_data() const
{
string received_data;
try
* Close the active session.
* @return 0 if all is fine, -1 on error
*/
-int NetHelper::close_connection()
+int NetHelper::close_connection() const
{
try
{
int open_connection(const std::string& _host, const std::string& _port) const;
- int send_data(const std::string& data);
+ int send_data(const std::string& data) const;
- std::string receive_data();
+ std::string receive_data() const;
- int close_connection();
+ int close_connection() const;
};
* Getter for member Lastupdated.
* @return Value of member Lastupdated.
*/
-list<int> Service::get_last_updates()
+list<int> Service::get_last_updates() const
{
return LastUpdates;
}
std::string get_password() const;
void set_last_updates(std::list<int> _last_updates);
- std::list<int> get_last_updates();
+ std::list<int> get_last_updates() const;
void set_actual_ip(const std::string& _actual_ip);
std::string get_actual_ip() const;
* Will close the session.
* @return 0 if all is fine, throws boost::syste::system_error if something went wrong.
*/
-int TCPService::close() throw (boost::system::system_error)
+void TCPService::close() throw (boost::system::system_error)
{
boost::system::error_code error_code;
if ( error_code )
throw boost::system::system_error(error_code);
- return 0;
+ return;
}
void write_to_socket(const std::string& data) throw (boost::system::system_error);
- int close() throw (boost::system::system_error);
+ void close() throw (boost::system::system_error);
};
#endif