• BufferedReader input = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
  • 7-Amaliy ish. 430-21 guruh talabasi: Rasuljonov Nurali Tekshirdi: Muxammedinov Kobeysin




    Download 0,9 Mb.
    bet2/8
    Sana18.05.2024
    Hajmi0,9 Mb.
    #242341
    1   2   3   4   5   6   7   8
    Bog'liq
    7ish00

    Topshiriq:


    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:


    1. 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.


    16.

    Rombning yuzini topish

    17.

    N ta sonning o‘rta arifmetigini hisoblash



    17



    package javafx;

    import java.io.*;

    import java.net.*;


    public class Server {

    public static void main(String[] args) throws IOException {

    // Server soketini yaratish

    try (ServerSocket serverSocket = new ServerSocket(5000)) {

    System.out.println("Server ishga tushdi...");

    while (true) {

    try (Socket clientSocket = serverSocket.accept()) {

    System.out.println("Klient ulandi...");


    // Klientdan sonlar sonini (N) va sonlarni qabul qilish

    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());

    }



    Download 0,9 Mb.
    1   2   3   4   5   6   7   8




    Download 0,9 Mb.

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    7-Amaliy ish. 430-21 guruh talabasi: Rasuljonov Nurali Tekshirdi: Muxammedinov Kobeysin

    Download 0,9 Mb.