use a pipe to communicate events to server