specify the ip and port.

This commit is contained in:
miaodx 2017-05-29 23:48:42 +08:00
parent 8a380c6620
commit 7dccf41b76

View File

@ -43,7 +43,11 @@ int client_round(fr::TcpSocket& socket)
int main() int main()
{ {
fr::TcpSocket socket; fr::TcpSocket socket;
if (socket.connect("127.0.0.1", "8081") != fr::Socket::Success)
string server_ip = "127.0.0.1";
string server_port = "8081";
if (socket.connect(server_ip, server_port) != fr::Socket::Success)
{ {
//Failed to connect //Failed to connect
cout << "CLIENT:it seem that the socket can be accessed or there is no such socket at all" << endl; cout << "CLIENT:it seem that the socket can be accessed or there is no such socket at all" << endl;