简体   繁体   中英

p2p file transfer over internet

I know there are several similar questions out there such as this one. I need to set up a connection between two computers and be able to send a large file. Let me explain the problems that I encountered when reading similar posts:

1) lots of them talked about tcp connections. I was able to send data but most of the time I was not able to send large amounts of data.

2) most of the examples where created in local networks. I was able to send data over two different networks over the internet with the tcp examples but I had to open ports on the router and forward them to the computer that I wanted to communicate to.

3) Libraries such as monotorrent or bitsharp where hard to find and I did not find good examples. I where not able to make them work.

so in short I just need to send files from one computer to another computer over the internet and I don't want to open ports on the router nor do any kind of port forwarding. people do not have to open ports on their routers when using limewire for example and they are downloading files from someone else computer. It will be nice if someone can provide me with a short example of how to set up the server and how to send a file to the server with the client code.

The port opening and forwarding problem that you mention is a very real one, and there is no easy work around. Applications like uTorrent use UPnP port mapping and / or NAT-PMP to talk to your router automatically and get it to do the relevant port-mappings "on the fly". Not all routers implement these protocols (and in many cases, users might disallow their use for security reasons), so the web is littered with questions on how to do port forwarding for limewire, uTorrent, etc.

Other than reading up on this, I would recommend that you specify your questions in a bit more detail, eg:

I was able to send data but most of the time I was not able to send large amounts of data.

this is a bit too vague for us to guess at what the problem is. What size file were you sending, over what connection, did you get errors, or was it just slow, etc?

Binfer does exactly what you are trying to do except that it is closed source and commercial. I dont think that is is trivial to do something like that, hence you probably wont find any examples to do that. A long time ago, I dabbled with JXTA, which promised a lot but delivered too little.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM