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
|
|
|
|
2017-04-04 01:54:41 +00:00
|
|
|
/**
|
|
|
|
* Methods for tcp sockets
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a TCP socket.
|
|
|
|
* @returns the socket descriptor returned by socket()
|
2016-11-10 22:36:42 +00:00
|
|
|
*/
|
|
|
|
int socket_tcp4(void)
|
|
|
|
{
|
|
|
|
int s;
|
|
|
|
s = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
|
|
|
|
return s;
|
|
|
|
}
|