This method determines whether this message has been previously received or not.
If it has been previously received, this method returns true.
If it is older than a preset limit, this method returns true.
Otherwise this method returns undefined, and forwards the message appropriately.

This function connects you to a specific node in the overall network.
Connecting to one node should connect you to the rest of the network,
however if you connect to the wrong subnet, the handshake failure involved
is silent. You can check this by looking at the truthiness of this objects
routing table. Example:

>varconn=newmesh.mesh_socket('localhost',4444);>conn.connect('localhost',5555);>//do some other setup for your program>if(!conn.routing_table){...conn.connect('localhost',6666);// any fallback address...}

Arguments:

addr (string) – A string address

port (number) – A positive, integral port

id – A string-like object which represents the expected ID of this node

Note

While in the Python version there are more thorough checks on this, the Javascript
implementation can connect to itself. There are checks to keep this from happening
automatically, but it’s still trivial to override this via human intervention. Please
do not try to connect to yourself.

This sends a message to all of your peers. If you use default values it will send it to everyone on the network

Arguments:

packets – A list of strings or Buffer-like objects you want your peers to receive

flag – A string or Buffer-like object which defines your flag. In other words, this defines packet 0.

type – A string or Buffer-like object which defines your message type. Changing this from default can have adverse effects.

Warning

If you change the type attribute from default values, bad things could happen. It MUST be a value from js2p.base.flags ,
and more specifically, it MUST be either broadcast or whisper. The only other valid flags are waterfall and renegotiate,
but these are RESERVED and must NOT be used.