Article View: borland.public.jbuilder.java.api
Article #1754Re: Quick question about sockets.
From: Reid Pinchback
Date: Wed, 26 Sep 2001 12:46
Date: Wed, 26 Sep 2001 12:46
29 lines
2860 bytes
2860 bytes
"Joi Ellis [TeamB]" wrote: > Alex Colic <alex.colic@pop-ware.com> wrote: > > Ok, got the book looking at the examples. > > > Question: the apps that are doing the listening are a bunch of web apps > > jsp/servlets. Lets say I have 5 of them and they all need to listen on this > > port. If I create a monitor class that uses a ServerSocket than I can only > > have one of these web apps listening. > > Hrm. I thought Jsp/servlets run only when the web server is processing a page > request. You don't want to use jsp/servlets for this, I don't think. I think the problem is with how Alex worded the description. The servlets would not, per se, "listen". The ServerSocket would have to forward a request to the appropriate servlet. This is no different from JSP model 2 except that the delegation is being handled by the ServerSocket instead of a central controlling servlet. The complex portion is that servlets and JSPs generally produce output, normally sent back along the HTTP connection that the client originally opened. Unless Alex is using HTTP as the basis for that client-server interaction (in which case he wouldn't need to bother creating a ServerSocket at all, just bind his JSP/servlet container to the port), he'll need to create a specialization of servlet so it knows about this socket and the protocol. Not sure how you'd get JSPs to work this way since I don't know if there is a way to control which servlet class the JSP compiler will extend (definitely not something I've tried to do before).
Technical Details
Message-ID:
<3BB1CE60.2C644804@mpi.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!paloalto-snh1.gtei.net!news.gtei.net!paloalto-snr1.gtei.net.POSTED!not-for-mailReferences:
<3b97d61e_1@dnews> <3b9859d6$1_2@dnews> <3b98be46$1_2@dnews> <3b98cc80_1@dnews> <3b98d3f5_1@dnews> <3b98d542_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,75eb349919d2da57 X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2001-09-26 05:46:20 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!paloalto-snh1.gtei.net!news.gtei.net!paloalto-snr1.gtei.net.POSTED!not-for-mail Message-ID: <3BB1CE60.2C644804@mpi.com> From: Reid Pinchback <pinchbac@mpi.com> Organization: Millennium Pharmaceuticals, Inc X-Mailer: Mozilla 4.76 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.api Subject: Re: Quick question about sockets. References: <3b97d61e_1@dnews> <3b9859d6$1_2@dnews> <3b98be46$1_2@dnews> <3b98cc80_1@dnews> <3b98d3f5_1@dnews> <3b98d542_1@dnews> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 33 X-Trace: /bV2//31flLnYaj6+OVglhmQCB7JNgdQ5dDnpoAZFpLpfIvahi7wKCAz827WPNBeoKZwscJaPVtF!GbyS8Z+NpLnHJDFx9NEG4pDC+HkUhmCVfvwjbv8Tl4sAIOcTC7J1Vhs/OxAcow== X-Complaints-To: abuse@gte.net X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly NNTP-Posting-Date: Wed, 26 Sep 2001 12:46:20 GMT Distribution: world Date: Wed, 26 Sep 2001 12:46:20 GMT