-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtest.c
40 lines (35 loc) · 831 Bytes
/
test.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//use http;
int global[5] = {1, 2, 3, 4, 5};
//int ctotal = 0;
str a = '1234';
char getStr(int c){
lp (int i = 0; i < 4; i = i+1) {
str b = a;
ret b[0];
}
ret a[5];
}
int changeNumtoZero(int num){
num = 2;
ret num;
}
int main(){
//str a = repeated 0 25;
echo('init web framework');
int socketId = getSocket();
echo('socket id is',socketId);
str url = 'file.kingtous.cn';
str port = '443';
echo('url is:',url,' port is:',port);
int state = connectSocket(socketId,url,port);
state = isSocketConnected(socketId);
if (state == 0){
echo('socket connected');
echo('sending get request');
str response = getRequest(socketId,url,'/');
echo('response is:');
echo(response);
}
closeSocket(socketId);
ret 1;
}