🐛 Fix client not connecting
This commit is contained in:
parent
9b2706ed81
commit
2a5a735fde
1 changed files with 9 additions and 0 deletions
|
@ -25,6 +25,15 @@ int main() {
|
||||||
serverAdress.sin_port = htons(8080);
|
serverAdress.sin_port = htons(8080);
|
||||||
serverAdress.sin_addr.s_addr = inet_addr("127.0.0.50");
|
serverAdress.sin_addr.s_addr = inet_addr("127.0.0.50");
|
||||||
|
|
||||||
|
int connectStatus = connect(clientSocket, (struct sockaddr *)&serverAdress,
|
||||||
|
sizeof(serverAdress));
|
||||||
|
if (connectStatus != 0) {
|
||||||
|
cout << "Failed to connect";
|
||||||
|
return connectStatus;
|
||||||
|
} else {
|
||||||
|
cout << "CONNECTED!" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
Message message;
|
Message message;
|
||||||
cout << "Type message to server: ";
|
cout << "Type message to server: ";
|
||||||
|
|
Reference in a new issue