Web Server Hangs

Blitz3D Forums/Blitz3D Programming/Web Server Hangs

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Function Server()

Local TCPServer = CreateTCPServer(80)
Local IncomingTCPStream

Print "Server started"

While Not KeyHit(1)

IncomingTCPStream = AcceptTCPStream(TCPServer)

If IncomingTCPStream Then

For x = 1 To 9
Print ReadLine$(IncomingTCPStream)
Next

WriteLine IncomingTCPStream , "HTTP/1.0 200 OK"
WriteLine IncomingTCPStream , "Connection: Close"
WriteLine IncomingTCPStream , ""

WriteLine(IncomingTCPStream , "<html> Hello world </html>")
WriteLine IncomingTCPStream , ""
CloseTCPStream(IncomingTCPStream)

End If

Wend

End Function