p2p

The easiest DHT to implement

核能气质少年 提交于 2019-12-02 15:58:56
Which Distributed Hash Table (DHT) is easiest to implement in Python? Any good example that is not bloated? I not am looking for a definition of DHT because I am more oriented and focused on design and implementation of such. If you are focused on implementation, rather than looking for an out-of-the-box solution, this article might help a bit: http://www.linuxjournal.com/article/6797 In my job I'm working with entagled . I can't say it's great code, but it seems to be the only Kademlia implementation for Python around. I think Kademlia has become the default DHT for most applications today,

How do you create a peer to peer connection without port forwarding or a centeralized server?

吃可爱长大的小学妹 提交于 2019-12-02 15:56:02
I recall reading an article about a proposed way to do this. If I recall correctly, the researchers successfully created a connection to a client on another network without port forwarding by sending HTTP packets to each other (Alice pretends that Bob is an HTTP web server while Bob pretends Alice is a web server). I'm not sure if that makes sense, but does anyone know where I can find the article or does anyone have any other ideas how to connect two clients together without a central server or port forwarding? Is it even possible? Edit: I would know the IPs of both computers and port the

P2P library for C++ [closed]

和自甴很熟 提交于 2019-12-02 15:31:22
Is there any good cross-platform C++ library for P2P networking (preferably UDP but TCP would work also). Originally I planned to use libjingle but since they do not provide any precompiled libraries and sport a quite messy build system I currently set it aside as too complicated. libtorrent.org build on top of boost, boost-asio is a library for P2P work good for me. It implement BitTorrent protocol, using TCP for transport data, TCP/UDP for peer exchange. libnice - Implements ICE protocol. One possible option is our MsgConnect product. Open-source license is available. libjingle can be a pain

How do I send file name with file using sockets in Java? [duplicate]

别来无恙 提交于 2019-12-02 15:23:16
问题 This question already has answers here : Java multiple file transfer over socket (2 answers) Closed 2 years ago . I have the following code which transfers file via Sockets. How do I send the file name? Socket socket = new Socket("localhost", port);//machine name, port number File file = new File(fileName); // Get the size of the file long length = file.length(); if (length > Integer.MAX_VALUE) { System.out.println("File is too large."); } byte[] bytes = new byte[(int) length];

How does DHT in torrents work?

£可爱£侵袭症+ 提交于 2019-12-02 13:55:40
I'm coding a p2p implementation that I would like to make decentralized however I'm having some trouble grasping how DHT in protocols like bittorrent work. How does the client know where the peers are if there is no tracker? Are peers stored in the actual torrent file? With trackerless/DHT torrents, peer IP addresses are stored in the DHT using the BitTorrent infohash as the key. Since all a tracker does, basically, is respond to put/get requests, this functionality corresponds exactly to the interface that a DHT (distributed hash table) provides: it allows you to look up and store IP

Identify client in peer to peer filesharing using Java and Corba. And build socket socket between 2 Clients

*爱你&永不变心* 提交于 2019-12-02 13:53:53
问题 I am developing a peer to peer file sharing application usig Java and CORBA. I am new to CORBA. So far I have successfully created a client program that registers a file in the SQL Database via CORBA. The table stores the following information : filename Share(Basically, it stores the option of sharing or not sharing the file in the network) HostName PortNumber I am stuck at this point: How do I find the hostname and portnumber of a client when registering the files to SQL?. Because I believe

Simple basic explanation of a Distributed Hash Table (DHT)

二次信任 提交于 2019-12-02 13:46:44
Could any one give an explanation on how a DHT works? Nothing too heavy, just the basics. Ok, they're fundamentally a pretty simple idea. A DHT gives you a dictionary-like interface, but the nodes are distributed across the network. The trick with DHTs is that the node that gets to store a particular key is found by hashing that key, so in effect your hash-table buckets are now independent nodes in a network. This gives a lot of fault-tolerance and reliability, and possibly some performance benefit, but it also throws up a lot of headaches. For example, what happens when a node leaves the

Cherry pick peers using Rasterbar libtorrent in Python

我是研究僧i 提交于 2019-12-02 13:17:41
问题 Does anyone know if it's possible to cherry pick peers to connect with using libtorrent? That is, after the tracker returns a list of peer IPs and ports, only a selected few will be connected with based on some defined criteria. Thanks 回答1: you can remove peers from the set using set_ip_filter(). you can add peers to the set by using connect_peer(). That's about all the control you have. The priority of which peers from the set to connect to in which order is hard coded. 来源: https:/

How do I send file name with file using sockets in Java? [duplicate]

妖精的绣舞 提交于 2019-12-02 10:54:14
This question already has an answer here: Java multiple file transfer over socket 2 answers I have the following code which transfers file via Sockets. How do I send the file name? Socket socket = new Socket("localhost", port);//machine name, port number File file = new File(fileName); // Get the size of the file long length = file.length(); if (length > Integer.MAX_VALUE) { System.out.println("File is too large."); } byte[] bytes = new byte[(int) length]; FileInputStream fis = new FileInputStream(file); BufferedInputStream bis = new BufferedInputStream(fis); BufferedOutputStream out = new

Cherry pick peers using Rasterbar libtorrent in Python

大兔子大兔子 提交于 2019-12-02 02:51:07
Does anyone know if it's possible to cherry pick peers to connect with using libtorrent? That is, after the tracker returns a list of peer IPs and ports, only a selected few will be connected with based on some defined criteria. Thanks you can remove peers from the set using set_ip_filter() . you can add peers to the set by using connect_peer() . That's about all the control you have. The priority of which peers from the set to connect to in which order is hard coded. 来源: https://stackoverflow.com/questions/26886154/cherry-pick-peers-using-rasterbar-libtorrent-in-python