connect method with struct sockaddr_in parameter