diff options
author | fcolin | 2007-02-01 09:54:50 +0000 |
---|---|---|
committer | fcolin | 2007-02-01 09:54:50 +0000 |
commit | 1af4e97ea8bb5dd7792f2acc93b98d07bbaef13b (patch) | |
tree | 0751051a41af73e68e850ae55d2f90635b1f8d03 /CSharp/Ivy/IvyPPC | |
parent | 77832236f70fdd8b73bd01e8fbd4e1d8cd2a9af1 (diff) | |
download | ivy-csharp-1af4e97ea8bb5dd7792f2acc93b98d07bbaef13b.zip ivy-csharp-1af4e97ea8bb5dd7792f2acc93b98d07bbaef13b.tar.gz ivy-csharp-1af4e97ea8bb5dd7792f2acc93b98d07bbaef13b.tar.bz2 ivy-csharp-1af4e97ea8bb5dd7792f2acc93b98d07bbaef13b.tar.xz |
Utilisateur : Fcolin Date : 19/09/05 Heure : 14:14 Archivé dans $/CSharp/Ivy Commentaire: Passage Nouvel API IVY ( pas teste ) (vss 27)
Diffstat (limited to 'CSharp/Ivy/IvyPPC')
-rw-r--r-- | CSharp/Ivy/IvyPPC/Ivy.cs | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/CSharp/Ivy/IvyPPC/Ivy.cs b/CSharp/Ivy/IvyPPC/Ivy.cs index 5e90a27..0790854 100644 --- a/CSharp/Ivy/IvyPPC/Ivy.cs +++ b/CSharp/Ivy/IvyPPC/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
|