www.pudn.com > fanccMSNr.src.rar > MessageListener.hpp
#pragma once
#include "Message.hpp"
namespace poral {
/**
* Interface for notifing messenger event.
* An event occured by message. (not bytestream)
*/
class MessageListener {
public:
/**
* Notifies a connecting socket that the connection attempt is complete.
*/
virtual void connected()=0;
/**
* Notifies a message arrived.
*/
virtual void messageArrived(const Message &msg)=0;
/**
* Notifies a closure by an error or by remote site,
* and notifices failure of esatblishing a connection.
* Does not called when local host attempted to close.
*/
virtual void failed()=0;
/**
* Notifies that MessageDispatcher::sendMessage() or sendBytes() enabled.
* NOTE that this method is NOT pure virtual method.
*/
virtual void sendable() {};
};
}