Fix message passing, client will timeout after 15min, refactoring of listen/write on server side