functionland / react-native-fula

React (JS/Native) wrapper for go-fula/mobile which creates a bridge between Fula and WNFS for React Native to enable developers create mobile native apps
MIT License
2 stars 5 forks source link

fula.connect always returns true #1

Closed ghorbani-m closed 2 years ago

ghorbani-m commented 2 years ago

connectmethod always returns true even if the endpoints (boxAddr) are wrong:

For example at a local environment all these addresses returns true: Correct address; '/ip4/192.168.0.200/tcp/4002/p2p/PeerId.....' Wrong: address: '/ip4/192.168.0.201/tcp/4002/p2p/PerrtId....'

farhoud commented 2 years ago

@ghorbani-m For decreasing the battery usage i don't dial and connect the peer i just add the peer to PeerStore for later request's. When user ask for send/receive operation connecting and opening the stream happens.

Proposal

Change Connect to AddBox

ghorbani-m commented 2 years ago

I understand, so we can make it optional so that developers could decide how connect method works connectmethod can get some parameters like this:

{
 connectImmediatly: boolean,
 idleTimeout: number,
 timeout: number
}

I don't know how much they are feasible.