🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #7881

Re: Server that listens to a port

#7881
From: ArShAm
Date: Wed, 09 May 2001 19:33
62 lines
2951 bytes
what did you mean : "for performance limit the maximum number of connections
and use a thread pool for waiting connections"
I didn't get about the pool.
And assume we can't determine the number of connections , maybe unlimitted.
What can I do for that?

Excuse me ,Would you please show me the skletton of that two kind of threads
you told? Thanks


ArShAm




"Calvin R. Smith" <calvinrsmith@hotmail.com> wrote in message
news:3afadec3$1_2@dnews...
> for sockets that are used by muli-clients what you should on the server
is:
> - create a thread that waits for a connection
> - when a connection is made pass the connection to another thread
> - go back to waiting for a connection
> - the thread that got handed a connection should only deal with that
> connection - it knows nothing about the other connections.
>
> for performance limit the maximum number of connections and use a thread
> pool
> for waiting connections
>
> "ArShAm" <ArShAm_MeTaL@hotmail.com> wrote in message
> news:3afac731_2@dnews...
> > Hi there
> >
> > How to listen to a port , while 3 clients wait for accept that ? and how
> to
> > handle the inputs?
> > Is there any events that can handle the ports for inputing?
> > Which method for threading is better?
> >     1.Each objects(each clients has an object to read from and write to)
> has
> > a thread for itself , and in run() method , it invoke yeld()
> >     2.The main class controls the threads
> >
> >
> >     Can I do this?( if I can , this is the best Idea I think ) :
> > each clients when send a msg to a port , it contains a code for client ,
> and
> > the server then knows the data is belongs to which client , and invoke
the
> > methods of the client class.If I can do this , how to listen to a port ,
> and
> > the other way , how to accept the port? I want to get a password from
> > clients , and then if password was incorrect , close the connection of
the
> > client.
> >
> > Thanks
> >     ArShAm
> >
> >
>
>
Technical Details
Message-ID: <3afaec75_1@dnews>
Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!216.218.192.242!news.he.net!news-hog.berkeley.edu!ucberkeley!nntp-relay.ihug.net!ihug.co.nz!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews
References: <3afac731_2@dnews> <3afadec3$1_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,43e608b758a1dc81
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-05-10 12:45:15 PST
From: "ArShAm" <ArShAm_MeTaL@hotmail.com>
Newsgroups: borland.public.jbuilder.java.language
References: <3afac731_2@dnews> <3afadec3$1_2@dnews>
Subject: Re: Server that listens to a port
Date: Thu, 10 May 2001 00:03:24 +0430
Lines: 64
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
NNTP-Posting-Host: 61.11.252.149
Message-ID: <3afaec75_1@dnews>
X-Trace: dnews 989523061 61.11.252.149 (10 May 2001 12:31:01 -0700)
Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!216.218.192.242!news.he.net!news-hog.berkeley.edu!ucberkeley!nntp-relay.ihug.net!ihug.co.nz!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews