get socket server address automatically

add function named getServerAddress