I am using paramiko to create a SFTP server. I have succeeded in uploading and downloading files to and from server on client request.But, I need to send a file from server to client whenever I need without client request. So, instead of breaking my head on making server send a file to client I want to make both machines act as both server and client in different ports so that when I need to send a file from machine A to B I can just Upload it to the SFTP server running on that port. Is this hypothesis possible?
You already know that you cannot send a file from an server to a client:
Can I send a file from SFTP Server to the Client without any request from it?
(The question on Server Fault has been deleted)

To answer your port question:
You do not care about client's port. It is automatically assigned to any available port, without you ever needing to know its value. In general, that's true for any TCP/IP connection, not only SFTP.
So you can just run SFTP server on both machines on the standard port 22. And use your client code on the other machine to connect to it.
Is it possible to run both SFTP server and client in a same machine on different ports?