Chance to simplify TcpSuite ping-pong
Closed this issue · 2 comments
We are chasing more important errors in TcpSuite ping-pong.
Whilst chasing those, I noticed the lines in the client side
_ <- IO(
assert(clue(clientLocalAddr.asInstanceOf[InetSocketAddress].getPort()) != 0)
Does that tell us anything we do not already know, or that the writes immediately
below will not complain about. I have a hard time imagining how connect()
could
succeed without setting a localAddress. Perhaps this was early development
time only belt-and-suspenders implementation insurance code?
Yes, belt-and-suspenders I think 😆 we now have a better test for this here I believe:
epollcat/tests/shared/src/test/scala/epollcat/TcpSuite.scala
Lines 169 to 187 in f87cccc
Yes, this is a better test.
By my reading this is OK, because the ServerSocket is listening(), as part of pseudo-JVM bind(),
and the client connection can happen as long as there is only a short pause before the accept.
I would have to check what the definition of "short" is: seconds?