473,383 Members | 1,818 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

finding our the port number

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
Nov 15 '05 #1
1 2938
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.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"wobbles" <no***************************@killspam.hotmail.co m> wrote in
message news:bo********************************@4ax.com...
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


Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Alexander N. Spitzer | last post by:
If I have a machine with 3 virtual IP addresses (192.168.1.), how can I start 3 instances of the same RMI application (each started with different properties/configs), each listening on the port...
0
by: Helge Jensen | last post by:
Having posted in microsoft.public.dotnet.framework.sdk and microsoft.public.dotnet.framework.wmi without receiving any response, I posthere on the off-chance that someone who isn't following those...
5
by: Jason | last post by:
After a server accepts a client connection on a certain port, a new socket is created on the server on a system managed dynamic port to handle the connection. Please confirm this. If so, how...
3
by: MLH | last post by:
I found some code Dev Ashish posted nearly a decade ago in response to someone's inquiry describing their need to dial a number, monitor call progress and determine whether it was busy. This was...
6
by: pekspro | last post by:
I need some code that gets the address from a server. I read somewhere that you could do this by starting some broadcast server using UDP. The client should send an broadcast message, and when the...
0
by: 14Dallas | last post by:
Hi, I have been working with another programmer to write this code. I haven't written code in years - DBase III and Pascal - anyways, back to my code question. The program opens a file and...
9
by: xparrot1 | last post by:
I know that I can get the SERVER port number like this: HttpContext.Current.Request.ServerVariables My question is how do I get the remote CLIENT port number? Thanks Derek
5
by: questionit | last post by:
How to find the port number for your PC ? i am writing a code which will send a message to some other machine. now just need to know the port number to use !! Thanks
2
by: Paul Sijben | last post by:
To automate/ease configuration in my app I am trying to find out to which serial port a certain bluetooth device is connected. With pybluez I can find out which bluetooth devices I have, but it...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.