Jason Schneekloth
9/28/2004 12:47:00 AM
OK, I'm working on making the simplest version of a remoting app that I
possibly can....basically, I'm trying to implement a Broker object to go
between a client and a server, so, I have a client and I have a server setup.
I have the server register the type IBroker with the system:
namespace Share
{
public delegate void ServerToClient(string data);
public delegate void ClientToServer(string data);
public interface IBroker
{
event ServerToClient ServerToClientEvent;
event ClientToServer ClientToServerEvent;
void SendServer(string data);
void SendClient(string data);
}
}
I implement this server side as a Broker object. No biggy. I register it,
then right after I register it in the server, I get an instance of the
IBroker object (actually a Broker object, but just being consistent):
this.broker = (IBroker)Activator.GetObject(typeof(IBroker),
"tcp://localhost:8080/TheBroker");
this.broker.ClientToServerEvent += new
ClientToServer(broker_ClientToServerEvent);
On the call to "this.broker.ClientToServer += ....." I get a
SerializationException thrown which has the following error:
"An unhandled exception of type
'System.Runtime.Serialization.SerializationException' occurred in mscorlib.dll
Additional information: Serialization will not deserialize delegates to
non-public methods."
I have no private delegates defined anywhere, everything is public. I've
done some searching on the web, but still can't figure this out, please help!!
Jason Schneekloth