Click here to Skip to main content
11,932,103 members (60,706 online)
Rate this:
Please Sign up or sign in to vote.
See more: .NET3.0 C# .NET C#4.0
Please help me to program a project server/client in C#.
the problem is how to detect a IP of a client in my server, and the server detect all PC connect in the same network of the server..
thanks for advance!!!
Posted 3-Jan-12 7:58am
Edited 6-Jan-12 11:20am
SAKryukov 3-Jan-12 13:02pm
Why do you need the client IP? If you use TCP and the client is connected, you don't need it. What level of networking are you going to use?
anpo1988 3-Jan-12 13:07pm
I need that the server detect Automatically the client without configuration, do you understand me or not?
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Firstly try making use of Google "C# client server".
Secondly this may be urgent to you but it is not to us.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

There are some architectures that do kind of a auto configuration.
This may base on broadcasting a request in the LAN and all clients are advised to respond.

This becomes far more tricky if you have dynamically coming and going server/client nodes and you want this to work reliably.

E.g. check the DLNA protocols, UPnP, or on a completely different technology: the FireWire Configuration Mechanisms.

If you go that path by inventing the weel yourself, and if you aim to a reliable system, this approach opens the box of pandora:
  • handle slow responding clients
  • deal with network dropouts (e.g. WIFI issues)
  • deal with re-connecting clients after a client crash or network dropout (the client did not say bye-bye before leaving the network, so, you need to be able to distinguish conflicts and re-connections (use the "bye-bye hello" pattern?)
  • nasty timeout issues (don't slow down the configuration by non-cooperative clients)
  • avoid broadcast event storms (do not re-configure too often)
  • ...

So, if you have no real requirement that the server knows up-font all (potential) clients: don't go that path.

It will cost you a lot of time and money to get the sytem running in a decent way.



This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web04 | 2.8.151126.1 | Last Updated 6 Jan 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100