c-libp2p/net/udp.c

17 lines
257 B
C
Raw Normal View History

2016-11-10 22:43:31 +00:00
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include "libp2p/net/p2pnet.h"
2016-11-10 22:43:31 +00:00
/* Create a UDP socket.
*/
int socket_udp4(void)
{
int s;
s = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (s == -1) return -1;
return s;
}