some tool code for unix network programming