diff options
author | fcolin | 2007-02-01 09:42:51 +0000 |
---|---|---|
committer | fcolin | 2007-02-01 09:42:51 +0000 |
commit | 2315589a7213c1f20b9907949c5512468c34daab (patch) | |
tree | 5c1e078d8045ccfc804ae7d9eb116e6f6b994a76 | |
parent | 49c776058c0d6d730fc3084dd6dfe25a94606c40 (diff) | |
download | ivy-csharp-2315589a7213c1f20b9907949c5512468c34daab.zip ivy-csharp-2315589a7213c1f20b9907949c5512468c34daab.tar.gz ivy-csharp-2315589a7213c1f20b9907949c5512468c34daab.tar.bz2 ivy-csharp-2315589a7213c1f20b9907949c5512468c34daab.tar.xz |
Utilisateur : Fcolin Date : 19/09/05 Heure : 14:14 Archivé dans $/CSharp/Ivy Commentaire: Passage Nouvel API IVY ( pas teste ) (vss 27)
-rw-r--r-- | CSharp/Ivy/Ivy/Ivy.cs | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/CSharp/Ivy/Ivy/Ivy.cs b/CSharp/Ivy/Ivy/Ivy.cs index 5e90a27..0790854 100644 --- a/CSharp/Ivy/Ivy/Ivy.cs +++ b/CSharp/Ivy/Ivy/Ivy.cs @@ -21,14 +21,14 @@ namespace IvyBus public class Ivy
{
/* Event handler */
- public delegate void DirectMessageHandler (IvyClient app, int id, string arg );
+ public delegate void DirectMessageHandler (IvyClient app, int id, byte[] arg );
public delegate void ClientConnectedHandler (IvyClient app);
public delegate void ClientDisconnectedHandler (IvyClient app);
public delegate bool DieHandler (IvyClient app, int id );
public delegate void ClientAddBindingHandler (IvyClient app, string arg );
public delegate void ClientRemoveBindingHandler (IvyClient app, string arg );
- public delegate void MessageHandler ( IvyClient app, string[] args );
+ public delegate void MessageHandler ( IvyClient app, IvyArgument args );
/* Event */
@@ -458,7 +458,7 @@ namespace IvyBus /// </returns>
//
// for compatibility raison with old IVY
- public int bindMsg(String regexp, MessageHandler callback)
+ public int bindMsg(string regexp, MessageHandler callback)
{
return bindMsg( regexp, callback, null);
}
@@ -571,7 +571,7 @@ namespace IvyBus return newbind.key;
}
- internal void FireDirectMessage (IvyClient app, int id, string arg )
+ internal void FireDirectMessage (IvyClient app, int id, byte[] arg )
{
if ( directMessageReceived != null )
{
@@ -661,11 +661,11 @@ namespace IvyBus //
/////////////////////////////////////////////////////////////////:
- internal void addClient(Socket socket)
+ internal void addClient(Socket socket,string appname)
{
if (stopped)
return ;
- IvyClient client = new IvyClient(this,socket);
+ IvyClient client = new IvyClient(this,socket,appname);
lock ( clients.SyncRoot )
{
clients.Add(client);
@@ -673,16 +673,17 @@ namespace IvyBus traceDebug(ClientNames);
}
- internal void callCallback(IvyClient client, Int32 key, string[] tab)
+ internal void callCallback(IvyClient client, int key, byte[] data)
{
ApplicationBinding bind = ( ApplicationBinding ) bindings[key];
if (bind.callback == null)
{
throw new IvyException("(callCallback) Not regexp matching id " + key);
}
+ IvyArgument arg = IvyArgument.Deserialize( data );
if ( syncControl != null )
- syncControl.Invoke( bind.callback, new object[]{client,tab});
- else bind.callback(client, tab);
+ syncControl.Invoke( bind.callback, new object[]{client,arg});
+ else bind.callback(client, arg);
}
@@ -759,7 +760,7 @@ namespace IvyBus if (stopped)
break;
// early disconnexion
- addClient(socket); // the peer called me
+ addClient(socket,"Unkown(waiting for name reception)"); // the peer called me
}
catch (IOException e)
{
@@ -781,7 +782,7 @@ namespace IvyBus private void traceDebug(string s)
{
if (debug)
- Console.Out.WriteLine("-->ivy<-- " + s);
+ Console.WriteLine("-->ivy<-- " + s);
}
internal class Domain
|