— Scott McNealy, Sun Microsystems Chairman, President and ceo



Download 40,57 Mb.
Pdf ko'rish
bet446/555
Sana26.05.2022
Hajmi40,57 Mb.
#609235
1   ...   442   443   444   445   446   447   448   449   ...   555
Bog'liq
Head First Java (Kathy Sierra, Bert Bates) (z-lib.org)

HeadFirst: 
If a pool is such a nice feature, why don’t stateful ses-
sion beans get one?
ServerSocket: 
We’re the only bean that can establish a real re-
lationship with a client. Unlike my cohorts, I can remember things 
from one method invocation to the next. I can maintain a conversa-
tion with a client, and keep track of the current state. So as long as 
the client wants me, I’m at her service.
HeadFirst: 
What exactly do you mean by “state”?
ServerSocket: 
Picture an online shopping spree. You click the 
little button to put things into your cart, right? Well where do you 
think they go? Somebody has to keep track of your cart. But when 
you’re done shopping, my life (in this case, as the bean keeping your 
cart) has no meaning, and I’m cut loose, trying to stay one step 
ahead of the garbage collector.
This weeks interview:
ServerSocket
Java Exposed
brainbarbell
Brain Barbell
How does the server know how to 
communicate with the client? 
The client knows the IP address and port 
number of the server, but how is the server 
able to make a Socket connection with the 
client (and make input and output streams)?
Think about how / when / where the server 
gets knowledge about the client.
there are no
Dumb Questions
Q:
 The advice server code on the opposite 
page has a VERY serious limitation—it looks 
like it can handle only one client at a time!
A:
Yes, that’s right. It can’t accept a request 
from a client until it has finished with the 
current client and started the next iteration of 
the infinite loop (where it sits at the accept() 
call until a request comes in, at which time it 
makes a Socket with the new client and starts 
the process over again).
Q:

Download 40,57 Mb.

Do'stlaringiz bilan baham:
1   ...   442   443   444   445   446   447   448   449   ...   555




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish