2016-11-10 22:36:42 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <arpa/inet.h>
|
2017-02-02 19:10:12 +00:00
|
|
|
#include "libp2p/net/p2pnet.h"
|
2016-11-10 22:36:42 +00:00
|
|
|
|
|
|
|
/* Create a TCP socket.
|
|
|
|
*/
|
|
|
|
int socket_tcp4(void)
|
|
|
|
{
|
|
|
|
int s;
|
|
|
|
|
|
|
|
s = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
|
|
|
|
if (s == -1) return -1;
|
|
|
|
return s;
|
|
|
|
}
|