Skip to content

Instantly share code, notes, and snippets.

@hiroshiro
Created August 27, 2014 19:26
Show Gist options
  • Save hiroshiro/7fea8dcf8d8070ae6b16 to your computer and use it in GitHub Desktop.
Save hiroshiro/7fea8dcf8d8070ae6b16 to your computer and use it in GitHub Desktop.
socket creation
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
int
main()
{
int sock;
sock = socket(AF_INET,SOCK_STREAM,0);
if(sock < 0){
printf("socket failed\n");
return 1;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment