ytakano / libcage Goto Github PK
View Code? Open in Web Editor NEWNATs free DHT(Kademlia) library in C++.
License: BSD 3-Clause "New" or "Revised" License
NATs free DHT(Kademlia) library in C++.
License: BSD 3-Clause "New" or "Revised" License
1. What? libcage is NATs free DHT library which implements Kademlia. This enables decentralized key-value store and peer-to-peer communications via NATs. Even if both peers are under NATs, peers can communicate with each other. 2. How to compile libcage depends on: libevent (http://www.monkey.org/~provos/libevent/) boost (http://www.boost.org/) and uses C++ compiler and OMake (http://omake.metaprl.org/index.html). So, please install above libraries and applications before compiling. You can then compile as: $ cd libcage $ omake libcage uses libevent as a default event library. If you'd like to use libev instead of libevent, please use the EV option when compiling. $ omake EV=TRUE The DEBUG option enables debugging which passes -O0 and -g flags to the compiler. $ omake DEBUG=TRUE If you want to debug RDP, please add a -DDEBUG_RDP flag to the CXXFLAGS option. When enabled DEBUG_RDP, libcage outputs RDP packets to the standard error. $ omake CXXFLAGS=-DDEBUG_RDP 3. Install If you want to install to /usr/local, please type: $ omake install If you want to install to any other places, plese use PREFIX option. For example, to install to /opt/local, please type: $ omake install PREFIX=/opt/local 4. Uninstall If you have installed to /user/local, please type: $ omake uninstall If you have installed to any other places, plese use PREFIX option. $ omake uninstall PREFIX=/opt/local You can uninstall libcage as: # rm -rf /usr/local/include/libcage # rm /usr/local/lib/libcage*
It seems that the callbacks are very sensitive on timing. If execution of a callback (join, for example)
takes to much time, the join fails.
How to reproduce:
For an executable example see https://gist.github.com/098e0a3bec1e8059c529.
Otherwise, build up a join callback, sleep 2-3 seconds in there and see the join failing.
Hi,
if i want to transfer files,what i do ? and i not find TCP sock in this
The example2 join 100 nodes to the network.
Does it need a server?
Thanks
Hi,
When I tried to run your test code with 10000 nodes, I got it aborted and the message "event.c:878: timeout_next: Assertion 'tv->tv_usec >= 0' failed"
Any idea of this problem?
The TTL for put seems to be measured (by timestamp comparsion) in seconds rather than milliseconds
(as used in the examples).
There should be documentation for that.
If one sends a long (38325 bytes in my case) message directly to a peer it results in a segmentation fault
at the memcpy
in dgram::push2queue
p = pbuf->append(len);
memcpy(p, msg, len);
The size check in pbuf->append
results in p = NULL
which is not checked.
I'm not sure how to deal with this so I'm not supplying a patch, sorry.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.