module gameServer
export OpenURLConnection
procedure OpenURLConnection (httpCommand, url : string)
var line : string (1)
var netStream : int
netStream := Net.OpenConnection (url, 80)
if netStream <= 0 then
put "Unable to connect to ", url
return
end if
if httpCommand="GET" then
var HEADER : string := "GET /index.html" %HTTP/1.1+ chr (10) + "Host:
www..ca"
%var sendHEADER : string := HEADER + chr (10) + "Accept-Ranges: bytes" + chr (10) + "Connection: close" + chr (10) + chr (10)
put HEADER
put : netStream, HEADER
end if
loop
get : netStream, line : 1
put line ..
end loop
Net.CloseConnection (netStream)
end OpenURLConnection
end gameServer
put "Working"
gameServer.OpenURLConnection ("GET","www.yahoo.com")