I love the BASIC languages... (25)

18 Name: #!/usr/bin/anonymous : 2008-05-11 23:11 ID:YwRF6IVe

me neither, it was merely a heads up for those who think its a walk in the park just because it ends with "basic"
still, its a refreshing language and its multiplatform
i expect no less though

var t = threadcreate( cast(sub(byval as any ptr), @exit_on_escape), @sock )

var s = !"HTTP/1.0 200 OK\n" & !"Content-Type: text/html\n" !"Connection: Close\n\n"
s += !"<html> <head> <title> empty page </title> </head> <body> Hi. </body> </html>"

dim as socket_info si
do

dim as socket new_sock
if( new_sock.listen_to_new( sock ) ) then
? "Connection from " & *new_sock.connection_info

new_sock.put( *cast(ubyte ptr, strptr(s)), len(s) )
end if

loop while not sock.is_closed
threadwait( t )

a little snippet for a board daemon im making that will emulate this kind of board
basically it will have alot more than this thingie does and it will also be its own httpd :)
any ideas for features?
ill be adding telnet admin interface etc.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: