Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Custome Net.OpenURLConnection
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ecliptical




PostPosted: Wed Jan 04, 2006 12:19 am   Post subject: Custome Net.OpenURLConnection

Ok there are a few problems with the current Net.OpenURLConnection the main one being you CAN'T send your own HTTP commands (PUT,GET,OPTION..etc) i suspect this might be some sort of security feature since you could potentially make some nasty things anyway I'll assume you're responsible people.

code:
module gameServer
    export OpenURLConnection
    procedure OpenURLConnection (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
        var HEADER : string := "GET /index.html "
        put : netStream, HEADER
        loop
            get : netStream, line : 1
            delay (10)
            put line ..
        end loop
        Net.CloseConnection (netStream)
    end OpenURLConnection
end gameServer
put "Working"
gameServer.OpenURLConnection ("http://www.yahoo.com")

This still needs improvements but it seems to work =)
Sponsor
Sponsor
Sponsor
sponsor
MovieTheatre




PostPosted: Thu Feb 09, 2006 6:27 pm   Post subject: (No subject)

hmmmm
let c
look like a nice program made by CompSci Member

hehe
thanks
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: