mirror of
https://github.com/vishapoberon/vipak.git
synced 2026-04-05 20:42:26 +00:00
Alsmost works
This commit is contained in:
parent
4b5cb0ef76
commit
84b04c2b37
2 changed files with 35 additions and 0 deletions
29
http.Mod
Normal file
29
http.Mod
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
MODULE http;
|
||||||
|
IMPORT Internet, Out;
|
||||||
|
PROCEDURE get(host, port: ARRAY OF CHAR, VAR buff: ARRAY 1000 OF CHAR);
|
||||||
|
VAR
|
||||||
|
socket : Internet.Socket;
|
||||||
|
connected: BOOLEAN;
|
||||||
|
send: ARRAY 7 OF CHAR;
|
||||||
|
BEGIN
|
||||||
|
connected := Internet.Connect(host, port, socket);
|
||||||
|
send[0] := "G";
|
||||||
|
send[1] := "E";
|
||||||
|
send[2] := "T";
|
||||||
|
send[3] := 0DX;
|
||||||
|
send[4] := 0AX;
|
||||||
|
send[5] := " ";
|
||||||
|
(* Somewhy it's ignoring the last byte *)
|
||||||
|
|
||||||
|
connected := Internet.Write(socket, send);
|
||||||
|
connected := Internet.Read(socket, buff);
|
||||||
|
Internet.Disconnect(socket);
|
||||||
|
|
||||||
|
END get;
|
||||||
|
VAR
|
||||||
|
buff: ARRAY 1000 OF CHAR
|
||||||
|
BEGIN
|
||||||
|
get("google.am", "80", buff);
|
||||||
|
Out.String(buff);
|
||||||
|
Out.Ln;
|
||||||
|
END http.
|
||||||
6
makefile
6
makefile
|
|
@ -4,8 +4,14 @@ VOC = /opt/voc/bin/voc
|
||||||
all:
|
all:
|
||||||
$(VOC) -s types.Mod sockets.Mod netdb.Mod Internet.Mod stringHelpers.Mod time.Mod IRC.Mod test.Mod -m
|
$(VOC) -s types.Mod sockets.Mod netdb.Mod Internet.Mod stringHelpers.Mod time.Mod IRC.Mod test.Mod -m
|
||||||
|
|
||||||
|
http:
|
||||||
|
$(VOC) -s types.Mod sockets.Mod netdb.Mod Internet.Mod http.Mod -m
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm *.h
|
rm *.h
|
||||||
rm *.c
|
rm *.c
|
||||||
rm *.o
|
rm *.o
|
||||||
rm *.sym
|
rm *.sym
|
||||||
|
|
||||||
|
test: http
|
||||||
|
./http
|
||||||
Loading…
Add table
Add a link
Reference in a new issue