Skip to content

created#5

Open
Sla-als wants to merge 1 commit intomasterfrom
lesson06
Open

created#5
Sla-als wants to merge 1 commit intomasterfrom
lesson06

Conversation

@Sla-als
Copy link
Copy Markdown
Owner

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

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

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

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

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
Copy Markdown

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.

2 participants