reconnection, add MAX_PORT_LEN