Hey I got a remoting object as a seperate DLL saved as DVRL.dll
code as below
public class RemoteClass : MarshalByRefObject
{
public delegate void MsgSentHandler(String msg);
public event MsgSentHandler MsgEvent;
public string SendMSG(string msg)
{ if (MsgEvent != null)
MsgEvent(msg);
return "Hello";
}
}
then in my server application i got
public DVRL.RemoteClass obj;
private void ServerStart()
{
TcpChannel ch = new TcpChannel(8085);
ChannelServices.RegisterChannel(ch);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(DVRL.RemoteClass), "Remote",WellKnownObjectMode.Singleton);
obj = new DVRL.RemoteClass();
obj.MsgEvent += new DVRL.RemoteClass.MsgSentHandler(SayMSG);
}
private void SayMSG(String msg)
{
MessageBox.Show(msg);
}
but when i call the method SendMSG the event dont fire.. I do get the "Hello" return on the client tho
please help ;)
Loading
Replies
Know the answer? Post it — somebody with the same question will find it here.