Cov chav kawm twg yog siv rau kev sib txuas tsawg lub qhov (socket programming)?
Cov chav kawm twg yog siv rau kev sib txuas tsawg lub qhov (socket programming)?

Video: Cov chav kawm twg yog siv rau kev sib txuas tsawg lub qhov (socket programming)?

Video: Cov chav kawm twg yog siv rau kev sib txuas tsawg lub qhov (socket programming)?
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Kaum ib hlis
Anonim

Qhov (socket) . thiab ServerSocket cov chav kawm yog siv rau kev sib txuas - oriented qhov (socket) programming thiab DatagramSocket thiab DatagramPacket cov chav kawm yog siv rau kev sib txuas - tsawg 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.

Tsis tas li ntawd, cov txheej txheem twg yog siv rau kev sib txuas tsawg lub qhov (socket programming)?

Kev sib txuas tsis siv lub qhov (socket) siv Tus neeg siv Datagram raws tu qauv (UDP) tsis yog TCP/IP. UDP kev cai yog unreliable raws li lawv xa cov ntaub ntawv nyob rau hauv pob ntawv thiab tsis muaj tseeb hais tias nws yuav tuaj txog. Lawv yog siv nyob rau hauv daim ntawv thov uas xav tau ntau dua throughput tab sis muaj tsawg overheads.

Tom qab ntawd, lo lus nug yog, dab tsi yog qhov (socket) siv rau hauv kev ua haujlwm? Ib lub network lub qhov (socket) . yog ib qho kawg ntawm kev sib txuas lus ntawm ob qhov kev pab cuam uas khiav hauv lub network. Qhov (sockets) . yog tsim thiab siv nrog ib txheej ntawm programming thov los yog "function hu" qee zaum hu uathe cov qhov (socket) . daim ntawv thov programming interface (API).

Ib yam li ntawd, koj tuaj yeem nug, cov txheej txheem twg feem ntau siv nyob rau hauv cov chav kawm server qhov (socket)?

Piav: Public Qhov (socket) . txais () siv hauvServer Socket class . 2. Tus tsim ntawm Datagram Socketclass yog siv tsim ib datagram lub qhov (socket) . thiab khi nws nrog tus lej Chaw nres nkoj muab?

UDP lub qhov (socket) ua haujlwm li cas?

UDP qhov (socket) Cov kev niaj hnub ua kom yooj yim IP kev sib txuas lus siv tus neeg siv datagram raws tu qauv ( UDP ) Cov lus, hu ua datagrams, yog xa mus rau lwm tus tswv ntawm ib lub network tsis tas yuav teeb tsa tshwj xeeb kis tau tus mob channelsor cov ntaub ntawv ua ntej. Cov UDP qhov (socket) tsuas yog yuav tsum tau qhib rau kev sib txuas lus.

Pom zoo: