🎨 Impore formatting of output
This commit is contained in:
parent
2a5a735fde
commit
45e779c56f
1 changed files with 5 additions and 4 deletions
|
@ -38,15 +38,16 @@ int main() {
|
||||||
Message message;
|
Message message;
|
||||||
cout << "Type message to server: ";
|
cout << "Type message to server: ";
|
||||||
cin >> message.content;
|
cin >> message.content;
|
||||||
cout << endl;
|
|
||||||
message.username = "Client 1";
|
|
||||||
|
|
||||||
if (strcmp(message.content, "exit") == 0) {
|
if (strcmp(message.content, "exit") == 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << "Sending message to server as user: " << message.username << endl;
|
cout << endl;
|
||||||
send(clientSocket, message.content, strlen(message.content), 0);
|
message.username = "Client 1";
|
||||||
|
|
||||||
|
send(clientSocket, message.toString().data(),
|
||||||
|
strlen(message.toString().data()), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
close(clientSocket);
|
close(clientSocket);
|
||||||
|
|
Loading…
Reference in a new issue