Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

C# Auto Discovery

Posted on 2016-07-26
4
Medium Priority
?
165 Views
Last Modified: 2016-07-26
I found this article that contains code on a client / server application can communicate with each other without knowing their IP address prior the the first network handshake.  The article discusses using UDP.

http://www.nullskull.com/a/1551/clientserver-autodiscovery-in-c-and-udp-sockets.aspx

My understanding of UDP is that it is not as secure as TCP.  

Is there a TCP example?
Or any other advice?  I need a client to auto discover a server app without knowing the IP.  I know bonjour is a possibility but looking for another solution.

Thanks
0
Comment
Question by:CipherIS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 34

Expert Comment

by:it_saige
ID: 41729734
For this situation you want to use UDP.  It doesn't have to be secure because you are not making a secure connection, instead you are sending a network wide signal.  It's basically a ping.  For this ping you want the smaller footprint that a UDP packet allows for.  Anyone that is listening for the ping responds.

After you receive the ping acknowledgement do you attempt to make the secure tcp connection.  I believe that you think that you have to use a different port than that of which you currently use but that is not the case.

TCP/80 is not the same as UDP/80 (not implying that this is the port you use).

WCF even implements helper classes for UdpDiscovery:  https://msdn.microsoft.com/en-us/library/dd456791(v=vs.110).aspx

-saige-
0
 
LVL 1

Author Comment

by:CipherIS
ID: 41729930
Saige,

So if I understand correct, use UDP for the ping.  Once I receive the acknowledgement, then switch to TCP to make the secure connection?

Thanks
0
 
LVL 34

Accepted Solution

by:
it_saige earned 2000 total points
ID: 41729943
Exactly.  The information that you send back, is supposed to carry an acknowledgement, ip address and a port (if required).  The client then takes the acknowledgement and connects to the ip address and port using whatever mechanism you employ to secure tcp communications.

-saige-
0
 
LVL 1

Author Comment

by:CipherIS
ID: 41730200
I wouldn't have to worry about the security issues with UDP (e.g. DOS)?
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question