Add server tcp test and refactor dnode:connect a little.