Created
August 27, 2014 19:26
-
-
Save hiroshiro/7fea8dcf8d8070ae6b16 to your computer and use it in GitHub Desktop.
socket creation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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