finding our the port number

  • Thread starter Thread starter wobbles
  • Start date Start date
W

wobbles

Hi Everyone,

I have a server which reads information from a "server.exe.config"
file and a client that also reads from its "client.exe.config" file.

If the server location or the port number changes I'd like to write
(using streamwriter) a new config file for the client app.

So I have a few questions:
1. Is "writing" my own config file (for the client) a bad approach. If
so, why? What's a better approach?
2. How can I find out which port number my service is using? I'd like
my server-app to know this so that it can write the appropriate config
file for the client.

I've been googling (on q.2) for a while now but found nothing useful.

Thanks!
wobbles
 
Hi,

This is good question to ask in the
microsoft.public.dotnet.framework.remoting newsgroup. Still, I can suggest
the following: don't use configuration files and configure the remoting
subsystem programmatically. Thus you can store the port number somewhere in
the registry and configure the TCP channel using that number for both the
client and the server.

P.S. Hope you don't need to re-configure the client "on the fly". As
Windows, unlike Unix systems, is missing signals, this would require using
either cross-process messaging, or a named pipe, or a named synchronization
object.
 
Back
Top