File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
SocketClasses/src/UDP_Datagrams Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -9,16 +9,11 @@ public class DatagramServer {
9
9
public static void main (String [] args ) throws IOException {
10
10
try (DatagramSocket serverDatagramSocket = new DatagramSocket (7777 )){
11
11
byte [] readReceiveBuffer = new byte [128 ];
12
- DatagramPacket receivePacket =
13
- new DatagramPacket (readReceiveBuffer , readReceiveBuffer .length );
14
- /* Методы *.receive() и метод *.send() ничего не возвращают они выполняют работу */
15
- serverDatagramSocket .receive (receivePacket );
12
+ DatagramPacket receivePacket = new DatagramPacket (readReceiveBuffer , readReceiveBuffer .length );
13
+ serverDatagramSocket .receive (receivePacket ); // Методы *.receive() и метод *.send() ничего не возвращают они выполняют работу
16
14
17
- /*
18
- Передаем содержимое нашего буфера в String, благо
19
- мы знаем, что была отправлена - принята строка. И
20
- выводим на экран.
21
- */
15
+ /* Передаем содержимое нашего буфера в String, благо мы знаем, что была отправлена - принята строка. И выводим на экран. */
16
+
22
17
String receiveDataFromClient = new String (readReceiveBuffer ).trim ();
23
18
System .out .println (receiveDataFromClient );
24
19
}
You can’t perform that action at this time.
0 commit comments