Commit Graph

30 Commits

Author SHA1 Message Date
Derrick Hammer 2e62597cd6
*Don't need to toggle our event hook 2023-04-06 14:26:57 -04:00
Derrick Hammer b8b72450e6
*Notify the slave protomux that we have synced 2023-04-06 13:19:06 -04:00
Derrick Hammer 33b11cbde6
*In getSwarm and swarm init, await on .opened to ensure we are ready, only when we have an active relay
*Only set mux.syncState if not previously set
*change mux.syncState to emit syncProtomux
*ensure the state data are numbers
*check for undefined in the state data
2023-04-06 13:16:46 -04:00
Derrick Hammer 369b1d19a4
*remove the current listeners sync function from the syncProtomux before emitting to not create an infinite loop, and add back after 2023-04-05 03:51:04 -04:00
Derrick Hammer 053e309d98
*Initial version of syncProtomux api protocol that will keep Protomux channel/message tracking in sync between workers 2023-04-05 02:41:57 -04:00
Derrick Hammer 2f30b743f6
*Move existing connection logic up 2023-04-04 11:22:37 -04:00
Derrick Hammer c0b99e8146
*When listening for connections, send over any existing connections to the requester as if they are new 2023-04-04 08:07:02 -04:00
Derrick Hammer 2c3d15c734
*Use swarmEvents not swarm.onceSelf to emit the close 2023-03-29 14:48:15 -04:00
Derrick Hammer 2e1780e28f
*Refactor swarm event management to use a dedicated event emitter per swarm for efficiency 2023-03-19 15:16:51 -04:00
Derrick Hammer e7a0c381b9
*Set the max event listeners via const on the peer object 2023-03-19 07:19:19 -04:00
Derrick Hammer b76f0f12dd
*change close hook to be one time as it does not need to stay hooked, else memory leak 2023-03-18 14:41:20 -04:00
Derrick Hammer 5ea823679f
*remove debug line 2023-02-18 08:44:35 -05:00
Derrick Hammer 2ad6b1fd5d
*Wrap connection event in an init call event to survive the relay being recreated 2023-02-17 22:37:05 -05:00
Derrick Hammer db079ce214
*If we have an active relay, add close hook, else queue on ready hook to add close hook 2023-02-17 19:16:22 -05:00
Derrick Hammer ac7d1a0db5
*only return early if both activeRelay and ready are set 2023-02-17 08:10:14 -05:00
Derrick Hammer 5f733195c4
*Fix typo 2023-02-16 21:57:49 -05:00
Derrick Hammer 2a533d6f7f
*If the dht closes, then remove the connection handler and emit the close event on the swarm 2023-02-16 21:40:40 -05:00
Derrick Hammer 379649b006
*Create helper getSwarmToSocketConnectionId
*on join method, disable server mode
*rename handleJoinPeer to handleJoin
*rename handleSocketListenEvent to handleSocketListenEvent
*on socketListenEvent, if setReceiveUpdate is ever called, assume we want to terminate
* Ensure full 64 bit private key is passed to handlePresentSeedModule
*Re-organize api methods
*Add new socket methods
*Add socketGetInfo method which creates an IPV6 address from the pubkey
2023-02-06 12:33:11 -05:00
Derrick Hammer 236e445ff8
*Change ready to init
*Add new ready method that listens for a ready event but returns if activeRelay is set
2023-02-01 12:07:46 -05:00
Derrick Hammer 4e443f4ccb
*Replace dht references with swarm 2023-02-01 08:18:31 -05:00
Derrick Hammer d608392532
*Rewrite to use new design 2023-02-01 07:50:45 -05:00
Derrick Hammer ce3fbcad0b
*Bug fix and improve response handling 2022-09-19 08:11:54 -04:00
Derrick Hammer b25706e8ac
*Update DHT management 2022-08-31 17:14:42 -04:00
Derrick Hammer 4956592d1d
*add getRelayServers api method 2022-08-14 07:28:40 -04:00
Derrick Hammer 5652eccd1b
*Add method to get current relays in a DHT instance 2022-08-14 06:49:24 -04:00
Derrick Hammer f8229abf66
*Need to shift off the first element from hexToBuf 2022-08-13 20:05:51 -04:00
Derrick Hammer cd33e1508b
*add socketExists api method 2022-08-13 15:12:49 -04:00
Derrick Hammer 4e4a22542f
*Switch from Buffer to hexToBuf 2022-08-13 15:11:18 -04:00
Derrick Hammer 77c473611a
*Support multiple dht connections with a default DHT connection 2022-08-03 12:01:11 -04:00
Derrick Hammer 05f3916b4a *Initial version 2022-07-21 13:03:18 -04:00