Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
winsock functions
#1
I've managed to patch together a winsock implementation based on some VB code I found. It is VERY basic, and for the moment, you have to send all the headers manually yourself. It seems to work beautifully though.
Quote:C:\freeBASIC-v0.02b-win32\freeBASIC>winsock
Computer Name: NECROS
WSAStartup returns: 0
Results of SockConnect: 0
pHostinfo: 1361008
sockinfo.sin_addr: 1755441472
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html
Set-Cookie: PREF=ID=1f8e54537783b5f1:TM=1102571961:LM=1102571961:S=cibQxo9vBT98X
gBK; expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.google.com
Content-Encoding: gzip
Server: GWS/2.1
Content-Length: 1116
Date: Thu, 09 Dec 2004 05:59:21 GMT

▼ï
Destroying sockets

C:\freeBASIC-v0.02b-win32\freeBASIC>
This was my code accessing www.google.com. It's a start for sure...not nearly a complete solution, but this is the first successful winsock attempt I know about in FreeBASIC. Anyways...if someone would like to take the reins of this one, here's the sourcecode:

http://www.nodtveidt.net/fb/winsock.bas

You will also need a copy of libwsock32.a, which you can get from the mingw package. winsock.bas does not use any inclusions, as it declares its own API function calls. So give it a try...be sure to change the information inside it (notably, the header contained inside the "message" string) and see if this works for you. And someone please...run with this, this is the kind of stuff that seperates the men from the boys. Big Grin
I'd knock on wood, but my desk is particle board.
Reply


Messages In This Thread
winsock functions - by adosorken - 12-09-2004, 11:06 AM
winsock functions - by urger - 12-09-2004, 05:46 PM
winsock functions - by Jofers - 12-09-2004, 09:53 PM
winsock functions - by ShadowWolf - 12-23-2004, 03:20 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)