From 9ab87f39d7fc37e52d742d38b191eed9128d4b5b Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 7 Feb 2008 19:01:12 +0000 Subject: Wowee, I think all this new stuff works, Conduit I don't need now, so it's not done yet. The Client class now supports a function called getLink() which returns a ClientLink object. This object may then be passed off to any other class and called to send messages to that client object. It is threadsafe if ItoServer is being used, and not for Server. Sending a message via a ClientLink calls the onMessage function on the assosiated protocol. Note that sending messages from within protocol event handlers or functions they call, while safe, may be slow and it's reccomended that you avoid this. --- src/protocol.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/protocol.h') diff --git a/src/protocol.h b/src/protocol.h index c557512..61fff93 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -10,6 +10,8 @@ #include +#include "bu/fstring.h" + namespace Bu { class Client; @@ -26,6 +28,7 @@ namespace Bu virtual void onNewConnection( Bu::Client *pClient )=0; virtual void onNewData( Bu::Client *pClient )=0; + virtual void onMessage( Bu::Client *pClient, const Bu::FString &sMsg ); private: -- cgit v1.2.3