Skip to content

Conversation

@Sla-als
Copy link
Owner

@Sla-als Sla-als commented Apr 16, 2020

Подскажите, как сделать так, чтобы сообщения появлялись сразу, а не после нажатия на enter?

System.out.println(serverWord); // получив - выводим на экран
}

String word = reader.readLine(); // ждём клиент
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не сможем отправить сообщение, пока читаем ответ от сервера выше. Надо в отдельный поток убрать отправку

String word = input.readLine(); // ждём пока клиент что-нибудь нам напишет
System.out.println("Клиент: " + word);
}
String wordSvr = reader.readLine();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Аналогично. В отдельный поток

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants