2 #include <sys/socket.h>
3 #include <netinet/in.h>
10 //#include <sys/types.h>
11 //#include <sys/socket.h>
12 //#include <netinet/in.h>
13 //#include <arpa/inet.h>
31 int fd
=socket(PF_INET
,SOCK_STREAM
,IPPROTO_TCP
);
32 struct sockaddr_in si
;
33 si
.sin_family
=PF_INET
;
34 inet_aton("127.0.0.1",&si
.sin_addr
);
35 si
.sin_port
=htons(80);
36 connect(fd
,(struct sockaddr
*)si
,sizeof si
);
37 write(fd
,"GET / HTTP/1.0\r\n\r\n");
38 len
=read(fd
,buf
,sizeof buf
);
This page took 0.779001 seconds and 4 git commands to generate.