implement timeout.

add struct constructor to set some default values. remove useless
signal.