Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Couple of socket Qs
#1
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?
quote="Deleter"]judging gameplay, you can adaquately compare quake 4 with pong[/quote]
Reply
#2
Yes, see the winsock example, it's not the best, but it shows how you connect to a website and obtain it's content.
Reply
#3
The DNS server will resolve the IP for you, given a domain name. Plus what Z!re said Smile
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#4
plus there is an example for sdl_net that do what the two abowe sead lol
lt;_[_[_[_T-B-B-W_]_]_]_>
[Image: bfd2.gif]
Reply
#5
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?
Screwing with your reality since 1998.
Reply
#6
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
Reply
#7
Serious? That would be wicked.
Screwing with your reality since 1998.
Reply
#8
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
lt;_[_[_[_T-B-B-W_]_]_]_>
[Image: bfd2.gif]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)