Fixed the bug that the sockets cannot be connected