Couple of socket Qs - Printable Version +- Qbasicnews.com (http://qbasicnews.com/newforum) +-- Forum: Qbasic "like" compilers/interpreters (http://qbasicnews.com/newforum/forum-5.html) +--- Forum: FB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-15.html) +--- Thread: Couple of socket Qs (/thread-9213.html) |
Couple of socket Qs - Torahteen - 04-25-2006 First: Is there a way to open a socket from a url like "forum.qbasicnews.com" and the like? Basically, how would I get the IP from a domain name? Second: Is there a way to download an HTML file off of the internet using sockets? Couple of socket Qs - Z!re - 04-25-2006 Yes, see the winsock example, it's not the best, but it shows how you connect to a website and obtain it's content. Couple of socket Qs - na_th_an - 04-26-2006 The DNS server will resolve the IP for you, given a domain name. Plus what Z!re said Couple of socket Qs - tbbw - 04-26-2006 plus there is an example for sdl_net that do what the two abowe sead lol Couple of socket Qs - anarky - 04-28-2006 Trust me, I've looked over that WinSock example and got a headache. Perhaps someone more experienced can make an example library or wrapper to handle all the stuff for us. Let's say, I want to connect to http://www.qbasicnetwork.com. I could use a command like: Code: ConnectURL "address" or, Code: DownloadFile "address" "destination path" Similarly, an UploadFile command could be introduced, such as: Code: UploadFile "address", "username", "password", ftpport as integer, overwrite as integer Is something simple like this too much to ask? On this, when connecting to an IP for a server program counterpart, something like: Code: ConnectIP "xxx.xxx.xxx.xxx", port Thoughts? Couple of socket Qs - Anonymous - 04-28-2006 yeah, i'm sure eventually if noone else does it, i'll make a wrapper to make it real easy like that and i'll release it, cause i wanna make mmo's like everyone else, ya know? =p Couple of socket Qs - anarky - 04-28-2006 Serious? That would be wicked. Couple of socket Qs - tbbw - 04-29-2006 dude if u play around with the winsock example for a few days u wuld know how to use it tbh. just read thru the code a few times. put print here and there to see what path the code follows. also to read the .bi file wuld not hurt |