c - EADDRINUSE Address already in use avoidable? -


i testing socket class have written wraps linux socket api.

in test function following:

  1. create server socket
  2. bind/listen
  3. connect new socket
  4. accept on new socket
  5. send data between them recv , send.
  6. call shutdown(shut_wr) on both sides
  7. call recv on both sides, , 0 return value
  8. call close on 3 sockets

i repeat these 8 steps again.

i find intermittantly on bind in second iteration of steps eaddrinuse.

i of impression possible perform orderly shutdown in such fashion avoidable. aware of so_reuseaddr - possible orderly shutdown , block until port available again?


Comments

Popular posts from this blog

Multilayer CSV to filtered excel -

Listboxes in c# -

ios - Why must I define variables twice in the Header file? -