server: improve stat test
server: handle r/w to socket on the same layer.