Qbasicnews.com

Full Version: Couple of socket Qs
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
Yes, see the winsock example, it's not the best, but it shows how you connect to a website and obtain it's content.
The DNS server will resolve the IP for you, given a domain name. Plus what Z!re said Smile
plus there is an example for sdl_net that do what the two abowe sead lol
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
SendData whatever as combined string

Thoughts?

Anonymous

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
Serious? That would be wicked.
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 Smile