Cov txheej txheem twg uas feem ntau siv hauv ServerSocket chav kawm?
Cov txheej txheem twg uas feem ntau siv hauv ServerSocket chav kawm?

Video: Cov txheej txheem twg uas feem ntau siv hauv ServerSocket chav kawm?

Video: Cov txheej txheem twg uas feem ntau siv hauv ServerSocket chav kawm?
Video: Qhia Txheej Txheem Khawv Koob 2024, Kaum ib hlis
Anonim

pej xeem Socket txais () txoj kev no feem ntau siv hauv ServerSocket chav kawm - Java. Q.

Tsis tas li ntawd, cov txheej txheem twg yog feem ntau siv hauv cov chav kawm server qhov (socket)?

Nqe lus piav qhia: Public lub qhov (socket) . txais () txoj kev yog siv los ntawm ServerSocket chav kawm kom lees txais kev sib txuas lus thov raws nraim ib tus neeg siv khoom ib zaug. Cov neeg thov los ntawm kev pib qhov lub qhov (socket) . khoom nrog lub servers IP chaw nyob.

Qhov thib ob, ServerSocket yog dab tsi? java.net ua. ServerSocket A server qhov (socket) . tos kev thov tuaj rau hauv lub network. Nws ua qee qhov haujlwm raws li qhov kev thov ntawd, thiab tom qab ntawd tejzaum nws rov qab los rau tus neeg thov.

Ib yam li ntawd, nws raug nug, chav kawm twg yog siv rau kev sib txuas tsis muaj qhov (socket programming)?

Qhov (socket) . thiab ServerSocket chav kawm yog siv rau kev sib txuas-oriented qhov (socket programming) . thiab DatagramSocket thiab DatagramPacket chav kawm yog siv rau kev sib txuas-tsawg lub qhov (socket programming) .. Cov neeg siv khoom hauv qhov (socket programming) . yuav tsum paub ob yam ntaub ntawv: IP Chaw Nyob ntawm Server, thiab. Chaw nres nkoj naj npawb.

Qhov txawv ntawm qhov () thiab ServerSocket () chav kawm yog dab tsi?

Qhov txawv ntawm a Qhov (socket) . thiab a ServerSocket . Qhov (socket class) . yog txhais tau rau cov neeg siv khoom sab, yog li hauv a neeg sab koj yuav tsum tau ua ib yam khoom ntawm Qhov (socket class) . rau txhua daim ntawv thov networking, whereas rau server side networking daim ntawv thov ServerSocket chav kawm yog siv, hauv qhov no chav kawm txoj kev hu ua serversocket_object.

Pom zoo: