I want to do the following, please tell me if it's possible.
i hv written a messenger in java and now need to implement File Transfer. Say ClientA wants to trasfer a file to ClientB. What i was thinking of doing was to make ClientA open a ServerSocket and wait for ClientB to connect. ClientB will be given the IP and PORT of ClientA by a server in between. Once ClientB gets the IP/PORT of ClientA it creates a new socket and connects to ClientB. After the connection is established, ClientA pushes the file to ClientB.
i need to know
1) Will this work if ClientA is NOT behind a firewall but ClientB is.
2) What happens if ClientA is behind a firewall and ClientB isn't
3) What if both are behind a firewall
4) If ClientA accesses the internet through a router and has a static IP assigned to it in the intranet, what IP will ClientB need to have to access ClientA. Basically how will the IP be resolved?
Thnx in advance