Renamed handleRecvMsg to handleWrite