status-im / nim-websock

Websocket for Nim
77 stars 15 forks source link

suspicious inconsistent behaviour between posix vs windows regarding server teardown #40

Open jangko opened 3 years ago

jangko commented 3 years ago

when writing tests for UTF8, I forget to insert tear down code like snippet below.

on windows it still run ok, but on linux it scream with addr in use. I was expecting same behavior on both windows and posix os.

  var server: HttpServerRef
  let address = initTAddress("127.0.0.1:8888")

  suite "UTF-8 validator in action":
    teardown:
      await server.stop()
      await server.closeWait()
dryajov commented 3 years ago

I believe this is now taken care of by the new http backend.

jangko commented 3 years ago

after take a closer look, it seems not a nim-ws problem. probably chronos or OS behavior. nim-graphql http server also exhibit this behavior.

i think we can close this one.

dryajov commented 3 years ago

Let's dig a little more, maybe this is a bug in chronos or maybe we're not closing something correctly. There is also another weird behavior described in #58, it might be related.