Fixes for connections via secio

This commit is contained in:
John Jones 2017-03-02 16:18:02 -05:00
parent 3a38623dcc
commit d4fee344a7
3 changed files with 49 additions and 43 deletions

View file

@ -26,12 +26,17 @@ int ipfs_core_net_listen(struct IpfsNode* node, char* protocol, struct IpfsListe
/***
* Dial a peer
* @param node this node
* @param peer_id who to dial
* @param peer_id who to dial (null terminated string)
* @param protocol the protocol to use
* @param stream the resultant stream
* @returns true(1) on success, otherwise false(0)
*/
int ipsf_core_net_dial(struct IpfsNode* node, char* peer_id, char* protocol, struct Stream* stream) {
int ipsf_core_net_dial(const struct IpfsNode* node, const char* peer_id, const char* protocol, struct Stream* stream) {
//TODO: Implement this
// get the multiaddress from the peerstore
struct Libp2pPeer* peer = libp2p_peerstore_get_peer(node->peerstore, peer_id, strlen(peer_id));
// attempt to connect
// attempt to use the protocol passed in
return 0;
}