Flush socket after writing simulation messages