473,770 Members | 2,096 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

finding our the port number

Hi Everyone,

I have a server which reads information from a "server.exe.con fig"
file and a client that also reads from its "client.exe.con fig" 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 2971
Hi,

This is good question to ask in the
microsoft.publi c.dotnet.framew ork.remoting newsgroup. Still, I can suggest
the following: don't use configuration files and configure the remoting
subsystem programmaticall y. 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.hotma il.com> wrote in
message news:bo******** *************** *********@4ax.c om...
Hi Everyone,

I have a server which reads information from a "server.exe.con fig"
file and a client that also reads from its "client.exe.con fig" 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
15726
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 1234, but each instance binds to a different ip address. that is to say: instance #1 binds to 192.168.1.5/port 1234 instance #2 binds to 192.168.1.6/port 1234 instance #3 binds to 192.168.1.7/port 1234
0
2285
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 groups knows a solution. I'm using code (roughly like): using System; using System.Management; public class Foo {
5
4043
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 can I get the number of the dynamic port in the server (in server code)? Using LocalEndPoint.Port just returns the original listener port number. Thanks,
3
2677
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 back when A2.0 was more widely used, so the code is Access Basic. Autodialer is not the answer, as it requires users to take handsets off-hook manually. I find myself in need of more direct control of a voice/data/fax modem from an A97 program....
6
10326
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 server answering the client gets the address. But how do I implement this? I did this simple quick-hack: Server: Socket server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
0
5543
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 reads the contents that are seperated by spaces, not tabs - will never be seperated by tabs as it is output from another program. The contents of the file are essiantlly 3 fields/values # # Text Field 1 will be a number from 1 to 26, Field 2 will...
9
13575
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
27666
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
7030
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 will not tell me the serial port they are mapped to. Is there a way to figure this out from python? (I am insterested in the platforms WinXP and linux primarily) Paul Sijben
0
9618
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10260
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9906
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.