added some tests, closing sockets on closing server