Nepracujem s dynamickym polem z handleru signalu
[mirrors/Programs.git] / c / fork / client.c
... / ...
CommitLineData
1#include <sys/types.h>
2#include <sys/socket.h>
3#include <netinet/in.h>
4#include <arpa/inet.h>
5#include <netdb.h>
6#include <stdio.h>
7
8#include <stdlib.h>
9
10//#include <sys/types.h>
11//#include <sys/socket.h>
12//#include <netinet/in.h>
13//#include <arpa/inet.h>
14#include <sys/wait.h>
15#include <sys/stat.h>
16//#include <stdlib.h>
17//#include <stdio.h>
18#include <time.h>
19#include <unistd.h>
20#include <string.h>
21#include <dirent.h>
22#include <fcntl.h>
23#include <errno.h>
24
25
26int main() {
27
28
29char buf[4096];
30int len;
31int fd=socket(PF_INET,SOCK_STREAM,IPPROTO_TCP);
32struct sockaddr_in si;
33si.sin_family=PF_INET;
34inet_aton("127.0.0.1",&si.sin_addr);
35si.sin_port=htons(80);
36connect(fd,(struct sockaddr*)si,sizeof si);
37write(fd,"GET / HTTP/1.0\r\n\r\n");
38len=read(fd,buf,sizeof buf);
39close(fd);
40
41
42
43
44}
This page took 0.155246 seconds and 4 git commands to generate.