[Gambas-user] Trouble writing to Accepted Socket stream

T Lee Davidson t.lee.davidson at gmail.com
Sat Mar 30 01:10:31 CET 2019


The issue is not whether or not I am correctly implementing the HTTP protocol. The issue is that the Socket object isn't 
correctly writing to the stream.

The Socket doesn't become ready-to-write until AFTER I actually try to write to it. It's as if a Write attempt triggers the 
Socket.Write (ready-to-write) event handler. If I then attempt write to the stream in that handler, because it should be ready 
to right, it gets stuck in a self-triggering loop.

BTW, "HTTP/1.1 200 OK" & crlf & crlf & "Hello world!" should be sufficient to satisfy the browser. It works with test servers 
coded in Python, Golang, and Rust.


___
Lee


On 3/29/19 7:27 PM, Cedron Dawg wrote:
> I don't think you are implementing the HTTP protocol, or I don't see it.  I don't remember it that well either, sorry.
> 
> To get you started:https://www.w3.org/Protocols/rfc2616/rfc2616-sec1.html
> 
> I'm pretty sure the browser is waiting for you to send it a greeting as soon as you recieve the connection.


More information about the User mailing list