Remoting; firewall warning

  • Thread starter Thread starter Marc Gravell
  • Start date Start date
M

Marc Gravell

I am using remoting to talk between separate apps *on the same machine*;
currently my server startup code is as below, but it throws the XP firewall
warning dialog. Since I only need to connect locally, is there any way of
preventing this - i.e. can I tell it that I only want to accept local
connections? RemoteAgent is my shared type; the string in App is an alias to
the service.

Thanks in advance,

Marc

public static bool StartServer() {
try {
if (ChannelServices.GetChannel("http") == null) {
ChannelServices.RegisterChannel(new HttpChannel(Port),
false);
}
WellKnownServiceTypeEntry serviceType = new
WellKnownServiceTypeEntry(typeof(RemoteAgent), App,
WellKnownObjectMode.Singleton);
RemotingConfiguration.RegisterWellKnownServiceType(serviceType);
return true;
} catch (System.Net.Sockets.SocketException) {
return false; // server already running
}
}
 
I don't know if you require the use of RemoteAgent/HTTP, but since it
is only on a local machine, can you use Named Pipes for the remoting
channel? It should be much faster, and you won't have to worry about
the XP Firewall. If you are using .NET 2.0, it comes with an included
transport channel to do this: IpcChannel. If you are not, you would
have to implement a custom channel. Hopefully, you will be able to use
this, if not, it was worth a shot.
Abe
 
Thanks muchly; I will look into this immediately (sounds just like what I
wanted)
 
Back
Top