|
7-Amaliy ish. 430-21 guruh talabasi: Rasuljonov Nurali Tekshirdi: Muxammedinov Kobeysin
|
bet | 2/8 | Sana | 18.05.2024 | Hajmi | 0,9 Mb. | | #242341 |
Bog'liq 7ish00Topshiriq:
Talaba laboratoriya ishi uchun shaxsiy topshiriq oladi. Bu topshiriq bo‘yicha talaba TCP kliyent-server tarmoq dasturini JavaFX asosida yaratadi. Har bir talaba uchun shaxsiy topshiriq 9.1-jadvalda keltirilgan.
9.1-jadval
Topshiriq variantlari
Ishni bajarish tartibi:
qadam. Ish NetBeans IDE ishlab chiqarish muhitini yuklash bilan boshlanadi.
Buning uchun ish stolida turgan NetBeans IDE muhiti yorlig‘ini sichqonchaning chap tomoni ikki marta bosiladi.
17
package javafx; import java.io.*; import java.net.*;
public class Server { public static void main(String[] args) throws IOException { try (ServerSocket serverSocket = new ServerSocket(5000)) { System.out.println("Server ishga tushdi..."); while (true) { try (Socket clientSocket = serverSocket.accept()) { System.out.println("Klient ulandi...");
BufferedReader input = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); int N = Integer.parseInt(input.readLine());
int[] sonlar = new int[N]; for (int i = 0; i < N; i++) { sonlar[i] = Integer.parseInt(input.readLine()); }
|
| |