Hi there,
1) well, i asked if there is a way that some one with his own client will be
able to connect to my server and get the data as it was my client
(in case that he know the address and the port which is not so hard to
know

)?
You can't prevent this, it is *impossible*. People can always "port sniff"
to analyze a particular protocol. You can attempt to encrypt the data
between client and server using RSA encryption but that will not prevent
people decompiling your application.
2) About the ports issue, how can i find a free port (on the server and the
client) and how can i make my clients to
know this port each time since i have the port in some const in the
client and server?
Not many ports are in constant use, just use 1001, the liklihood of an
another application using that are very remote. Or the other way is to
upload a file to a web server each time the server is started and then have
the client download this file in order to locate the server.
3) how can i be sure that no one using my port, let say that you install my
client on your computer and there is another program that use this port?
Unlikely if you use port 1001, but if you are *really* that worried, you can
*pay* to have a port registered to your application, though who you go to
for this I have absolutly no idea!
4) i will check the RSA article, so Thanks.
Good idea ;-)
6) if you need to do some server that need to broadcast data to all of the
connected clients would you use the UDP or TCP ?
That is down for the server to do, I would use TCP for that as it requires a
solid connection and if the server needs to send packets to all *connected*
clients you should be using TCP.
7) what about performance deference between UDP and TCP ?
UDP is faster as it does not include fail safe measures and the like. But I
would not worry about performance being an issue because it is very unlikely
to cause your a problem. Just make sure that you make a "light weight" prot
ocol to maximize your bandwidth useage.
once again, Thanks for your help!
No probs! ;-)
Nick.