Q:

rsync in non-daemon

I want to know how rsync works in non-daemon mode ,and what it is exactly ?
From rsync man pages , I came to know how daemon mode works .
I know something about daemon mode. Daemon is a process continuously listening for connections in background.
Now , the scene is ,I don't want to use Daemon mode ,as it will require some dedicated port always to be in listening.
I want to know,how does the client(say, local machine) in non-daemon mode technically invokes the rsync listener on server(say,remote machine) and vice versa?
The reason for this approach is that , *I don't want client should know the port number of server before-hand * .
Any detail explanations will be appreciated. 

A:

From rsync man-page:

There  are  two  different  ways  for rsync to contact a remote
  system:
         using a remote-shell program as the transport (such as ssh or  rsh)  or
         contacting  an  rsync daemon directly via TCP.

So in non-deamon mode you can use ssh to connect and update your clients. In this case the initial connection through ssh will setup the client side so that rsync can connect without knowing the port number.

