#Closing a std.net.Server.Connection

1 messages · Page 1 of 1 (latest)

swift junco
#

I'm writing an HTTP server. It receives requests fine but I can't get a browser or curl to accept a response... the request just hangs indefinitely. I wrote all of the appropriate HTML headers etc but I'm assuming the connection would close automatically when it goes out of scope because I don't see any relevant functions.

#

I tried looking through the source for std.http.Server but it's a bit arcane.

#

I thought maybe I need to flush bytes but that is crashing the program.

swift junco
#

I'm stll perplexed by this. I've been trying to make it work with the new IO stream interface but it's confusing and never seems to write any data. If I try calling flush anywhere, it crashes.

swift junco
#

Managed to get it working first try with the deprecated stream.write() function though.

robust ridge
#

fwiw nothing will ever automatically happen when something goes out of scope in zig

unreal nova
#

If I try calling flush anywhere, it crashes.
This usually means you're using the interface incorrectly

swift junco
#

I troubleshooted it in depth and figured I'm using the interface wrong which is why I posted here.

#

Could never figure it out.

#

Seems like the same issue this guy had.