I'm looking for a simple way to implement this scenario:
Say I have two machines I'd like to share data between. The location/addresses of these machines can change at any time. I'd like both machines to check in to a central server to announce their availability. One of the two systems wants to pull a file from the other. I know that I can have the sink system make a request to the server, who then requests the file from the source, pulls it, then feeds it to the requester. However, this seems inefficient from a bandwidth perspective. The file will be transfered twice. Is there a system in place where the source c开发者_C百科an broadcast it directly to the sink?
Without being able to guarantee things like port forwarding if a system is behind a firewall etc. I don't know of a way.
Thanks.
When machine A
wants to send data to machine B
, A
sends a request to the central server C
. C
asks B
for permission. If accepted, C
gives B
's IP and port to A
. A
attempts to connect to B
directly. If unsuccessful (ie, if B
is behind a router/firewall), then A
notifies C
of the failure. C
then gives A
's IP and port to B
. B
attempts to connect directly to A
(which should be able to pass through B
's firewall/router). If either connection is successful, then A
has a direct connection to send data to B
. If both connections are unsuccessful (ie, if A
is also behind a firewall/router), then C
has to act as a proxy for all transfers between A
and B
.
精彩评论