c-libp2p/conn/connection.c

24 lines
537 B
C
Raw Normal View History

2017-02-13 18:26:41 +00:00
#include <stdlib.h>
#include "libp2p/conn/connection.h"
2017-02-13 22:41:31 +00:00
struct Connection* libp2p_conn_connection_new(struct TransportDialer* transport_dialer, struct MultiAddress* multiaddress) {
2017-02-13 18:26:41 +00:00
struct Connection* out = NULL;
if (transport_dialer != NULL) {
out = (struct Connection*)malloc(sizeof(struct Connection));
if (out != NULL) {
//TODO implement this
}
}
return out;
}
2017-02-13 22:41:31 +00:00
void libp2p_conn_connection_free(struct Connection* connection) {
if (connection != NULL) {
fclose(connection->socket_handle);
free(connection);
}
}