simpleweb-support Mailing List for Simple (Page 35)
Brought to you by:
niallg
You can subscribe to this list here.
2004 |
Jan
(1) |
Feb
(4) |
Mar
(2) |
Apr
(14) |
May
(22) |
Jun
(15) |
Jul
(9) |
Aug
(2) |
Sep
(7) |
Oct
(4) |
Nov
(2) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(7) |
Feb
(16) |
Mar
(17) |
Apr
|
May
(12) |
Jun
(4) |
Jul
(22) |
Aug
(50) |
Sep
(8) |
Oct
(23) |
Nov
(9) |
Dec
(50) |
2006 |
Jan
(6) |
Feb
(7) |
Mar
(8) |
Apr
(3) |
May
(13) |
Jun
(4) |
Jul
(2) |
Aug
|
Sep
(1) |
Oct
|
Nov
(6) |
Dec
(7) |
2007 |
Jan
(11) |
Feb
(3) |
Mar
(17) |
Apr
(21) |
May
(9) |
Jun
(4) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(8) |
Nov
(14) |
Dec
(3) |
2008 |
Jan
(3) |
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
(4) |
Aug
(4) |
Sep
(15) |
Oct
(9) |
Nov
(6) |
Dec
(2) |
2009 |
Jan
(29) |
Feb
(2) |
Mar
(8) |
Apr
(14) |
May
(4) |
Jun
(13) |
Jul
(5) |
Aug
|
Sep
|
Oct
(4) |
Nov
(3) |
Dec
(7) |
2010 |
Jan
|
Feb
(2) |
Mar
(61) |
Apr
(9) |
May
(10) |
Jun
(9) |
Jul
(10) |
Aug
(7) |
Sep
(15) |
Oct
(5) |
Nov
(2) |
Dec
(3) |
2011 |
Jan
(11) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
(4) |
Oct
|
Nov
(6) |
Dec
(9) |
2012 |
Jan
|
Feb
(1) |
Mar
(2) |
Apr
(3) |
May
(2) |
Jun
|
Jul
(17) |
Aug
|
Sep
|
Oct
|
Nov
(10) |
Dec
(5) |
2013 |
Jan
(2) |
Feb
(4) |
Mar
|
Apr
(12) |
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
(1) |
2014 |
Jan
|
Feb
(2) |
Mar
(6) |
Apr
|
May
|
Jun
(20) |
Jul
(12) |
Aug
(4) |
Sep
(3) |
Oct
(5) |
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2017 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Niall G. <ni...@em...> - 2004-05-20 14:23:21
|
Hi, Thanks for this bug report. I think the reason this is happening is that I changed the MonitoredOutputStream to use the MonitoredOutputStream.flushBytes() method instead of the OutputStream.flush(). In fixing this bug I must have introduced a new one. Ill have to run a few tests to see where the problem is, but you can be sure that I will release an update (2.4.2) as soon as I find it. Thanks for the feedback! Niall ----- Original Message ----- From: "Marc Novakowski" Date: Mon, 17 May 2004 11:47:23 -0700 To: Subject: [Simpleweb-Support] Chunked encoding changes Ive noticed a bit of a difference between 2.4 and 2.4.1 in the generation of chunked-encoded responses. I have a SOAP handler that uses Axis to generate SOAP responses, WSDL, etc. which worked fine in 2.4. However when I upgraded to 2.4.1 I noticed that Internet Explorer could not longer download the generated WSDL file that Axis writes to the simpleweb Response output stream. Upon closer inspection of the data written to the client, it appears that the last chunk in the response contains some extra CRLF characters. Specifically, there are 2 extra CRLFs before the 0 indicating last chunk. For example, here is what the last two chunks looked like in 2.4 (which works fine): 12b ervices" use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="EnsService"> <wsdl:port binding="impl:ensSoapBinding" name="ens"> <wsdlsoap:address location="http://transport.url"/> </wsdl:port> </wsdl:service> </wsdl:definitions> 0 And this is what the same file looks like when using 2.4.1: 12b ervices" use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="EnsService"> <wsdl:port binding="impl:ensSoapBinding" name="ens"> <wsdlsoap:address location="http://transport.url"/> </wsdl:port> </wsdl:service> </wsdl:definitions> 0 In both cases the 0 has two CRLFs after it (which is correct according to the spec) however in the 2.4.1 case it has two extra CRLFs before the 0 (for a total of 3). I dont think this is correct, and Internet Explorer seems to agree (it keeps spinning the globe, as if its waiting for more bytes). I tried going through the files in CVS to see where this might have been broken, but it looks like everything in there is about 9 months old, so Im not sure where the 2.4.1 source code lives (other than in the released tar.gz file). Ive tried modifying ChunkedOutputStream.doClose() to remove the doControl() before writing the 0, but that only removed one of the CRLFs before the 0. Im not quite sure where the other one is being written. Any help you can provide would be appreciated! Thanks, Marc Novakowski -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm |
From: Marc N. <ma...@ke...> - 2004-05-17 18:47:36
|
I've noticed a bit of a difference between 2.4 and 2.4.1 in the generation of chunked-encoded responses. I have a SOAP handler that uses Axis to generate SOAP responses, WSDL, etc. which worked fine in 2.4. However when I upgraded to 2.4.1 I noticed that Internet Explorer could not longer download the generated WSDL file that Axis writes to the simpleweb Response output stream. =20 Upon closer inspection of the data written to the client, it appears that the last chunk in the response contains some extra CRLF characters. Specifically, there are 2 extra CRLF's before the "0" indicating last chunk. =20 For example, here is what the last two chunks looked like in 2.4 (which works fine): =20 12b ervices" use=3D"literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name=3D"EnsService"> <wsdl:port binding=3D"impl:ensSoapBinding" name=3D"ens"> <wsdlsoap:address location=3D"http://transport.url"/> </wsdl:port> </wsdl:service> </wsdl:definitions> 0 =20 =20 And this is what the same file looks like when using 2.4.1: =20 12b ervices" use=3D"literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name=3D"EnsService"> <wsdl:port binding=3D"impl:ensSoapBinding" name=3D"ens"> <wsdlsoap:address location=3D"http://transport.url"/> </wsdl:port> </wsdl:service> </wsdl:definitions> =20 =20 0 =20 =20 In both cases the 0 has two CRLF's after it (which is correct according to the spec) however in the 2.4.1 case it has two extra CRLF's before the "0" (for a total of 3). I don't think this is correct, and Internet Explorer seems to agree (it keeps "spinning" the globe, as if it's waiting for more bytes). =20 I tried going through the files in CVS to see where this might have been broken, but it looks like everything in there is about 9 months old, so I'm not sure where the "2.4.1" source code lives (other than in the released tar.gz file). =20 I've tried modifying ChunkedOutputStream.doClose() to remove the "doControl()" before writing the "0", but that only removed one of the CRLF's before the 0. I'm not quite sure where the other one is being written. =20 Any help you can provide would be appreciated! =20 Thanks, Marc Novakowski |
From: Niall G. <nia...@an...> - 2004-05-13 10:19:42
|
Hi > 1. For the SSL Socket wraper, is there any situation that I should wrap > another method? Not as far as Simple is concerned, the only methods used by the simple.http.connect package are the ServerSocket.accept() and ServerSocket.isClosed(). However you may want to override the ServerSocket.close() method if you wish to terminate a connection. > 2. I am using Simple for SMPP to HTTP gateway so it is designed to be > able receive lots connection with relatively small data to be passed > around. So far I use Simple like this : > webserverConn = > new Connection(new SocketHandler( > PipelineHandlerFactory.getInstance(new HttpMainHandler()), > new BufferedPipelineFactory(2096)))); If the messages and responses are small then perhaps a BufferedPipelineFactory using 2K is too much, this will only help on pipelines where it will get allot of reuse across many requests. Apart from that I think you will probably know what is best! You may also want to look at the other PipelineHandlerFactory.getInstance method which will allow you to tweak the polling configuration. Regards, Niall |
From: bagas <ba...@in...> - 2004-05-13 04:16:13
|
Hi, Thanks you very much It work perfectly... I have other questions though .. 1. For the SSL Socket wraper, is there any situation that I should wrap another method? 2. I am using Simple for SMPP to HTTP gateway so it is designed to be able receive lots connection with relatively small data to be passed around. So far I use Simple like this : webserverConn = new Connection(new SocketHandler( PipelineHandlerFactory.getInstance(new HttpMainHandler()), new BufferedPipelineFactory(2096)))); Could you advice me better solution ? Thank you again. Regards, Rahmat Bagas Santoso -----Original Message----- From: sim...@li... [mailto:sim...@li...] On Behalf Of Niall Gallagher Sent: Tuesday, May 11, 2004 6:08 PM To: sim...@li... Subject: RE: [Simpleweb-Support] How to get noticed when SimpleServergoesdown ... Hi, > Server.connection.connect(socketFactory.createServerSocket(sslPort)); > > If I want to use interface Monitor (like you advice earlier for > ServerSocket), how can I do that? Mabye try and wrap the socketFactory.createServerSocket(sslPort) within the ServerSocket implementation and delegate to the created SSLServerSocket like this. Server.connection.connect(new MonitoredServerSocket(monitor, socketFactory.createServerSocket(sslPort))); public class MonitoredServerSocket extends ServerSocket { private Monitor monitor; private ServerSocket sock; public MonitoredServerSocket(Monitor monitor, ServerSocket sock){ this.monitor = monitor; this.sock = sock; } public boolean isClosed() { return sock.isClosed(); } public Socket accept() throws IOException { try { return sock.accept(); }catch(IOException e){ // as before ... } } } This should work.... Niall ------------------------------------------------------- This SF.Net email is sponsored by Sleepycat Software Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver higher performing products faster, at low TCO. http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3 _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Niall G. <nia...@an...> - 2004-05-11 11:08:27
|
Hi, > Server.connection.connect(socketFactory.createServerSocket(sslPort)); > > If I want to use interface Monitor (like you advice earlier for > ServerSocket), how can I do that? Mabye try and wrap the socketFactory.createServerSocket(sslPort) within the ServerSocket implementation and delegate to the created SSLServerSocket like this. Server.connection.connect(new MonitoredServerSocket(monitor, socketFactory.createServerSocket(sslPort))); public class MonitoredServerSocket extends ServerSocket { private Monitor monitor; private ServerSocket sock; public MonitoredServerSocket(Monitor monitor, ServerSocket sock){ this.monitor = monitor; this.sock = sock; } public boolean isClosed() { return sock.isClosed(); } public Socket accept() throws IOException { try { return sock.accept(); }catch(IOException e){ // as before ... } } } This should work.... Niall |
From: bagas <ba...@in...> - 2004-05-11 10:18:53
|
I currently init Https like this : String source = "keystore"; char[] storePassword = {'p'}; char[] keyPassword = {'p'}; KeyStore store = KeyStore.getInstance("JKS"); store.load(new FileInputStream(source), storePassword); KeyManagerFactory keyFactory = KeyManagerFactory.getInstance("SunX509"); keyFactory.init(store, keyPassword); SSLContext sslContext = SSLContext.getInstance("SSLv3"); sslContext.init(keyFactory.getKeyManagers(), null, null); ServerSocketFactory socketFactory = sslContext.getServerSocketFactory(); Server.connection.connect(socketFactory.createServerSocket(sslPort)); If I want to use interface Monitor (like you advice earlier for ServerSocket), how can I do that? Thank you very much Regards, Rahmat Bagas Santoso > In this case what you could do is extend the ServerSocket, this may not > be the most elegant solution but it is quite easy. Try somthing like > public class MonitoredServerSocket extends ServerSocket { > private Monitor monitor; > public MonitoredServerSocket(Monitor monitor, int port) { > super(port); > this.monitor = monitor; > } > public Socket accept() throws IOException { > try { > return super.accept(); > } catch(IOException e){ > monitor.notifyException(this, e); > throw e; > } > } > } > public interface Monitor { > > public void notifyException(ServerSocket sock, IOException e); > } |
From: Niall G. <nia...@an...> - 2004-05-11 09:16:23
|
Hi, > The URL for the simple-core-2.4.1 release is pointing to the wrong > location: > > http://simpleweb.sourceforge.net/download/2.4.1/simple-core-2.4.tar.gz > > Which results in a 404: Doh! yep ill have to fix that. Thanks Niall |
From: Niall G. <nia...@an...> - 2004-05-11 09:13:09
|
Hi, > If I am not mistaken, implementing simple.http.connect.SocketHandler can > only be used after the ServerSocket accepts a connection and makes a > Socket to handle the connection. > > But what I want is, to detect whether ServerSocket is still > listening/accepting or not. I don't think implementing > simple.http.connect.SocketHandler would solve this because the > ServerSocket is not accepting a connection (no Socket given to > SocketHandler yet). In this case what you could do is extend the ServerSocket, this may not be the most elegant solution but it is quite easy. Try somthing like public class MonitoredServerSocket extends ServerSocket { private Monitor monitor; public MonitoredServerSocket(Monitor monitor, int port) { super(port); this.monitor = monitor; } public Socket accept() throws IOException { try { return super.accept(); } catch(IOException e){ monitor.notifyException(this, e); throw e; } } } public interface Monitor { public void notifyException(ServerSocket sock, IOException e); } At least this way you can still use the ConnectionFactory without having to recode your own connection framework. Hope this is of use, Niall |
From: petite_abeille <pet...@ma...> - 2004-05-11 06:49:16
|
Hi, On the download page: http://simpleweb.sourceforge.net/download/2.4.1/ The URL for the simple-core-2.4.1 release is pointing to the wrong location: http://simpleweb.sourceforge.net/download/2.4.1/simple-core-2.4.tar.gz Which results in a 404: The requested URL /download/2.4.1/simple-core-2.4.tar.gz was not found on this server. I would venture that the correct URL should be: http://simpleweb.sourceforge.net/download/2.4.1/simple-core-2.4.1.tar.gz Cheers, PA. |
From: bagas <ba...@in...> - 2004-05-11 03:57:06
|
>Hi, >> is it running ServerSocket(80).close() would stop this server cleanly? > Not exactly, you need a handle on the ServerSocket given to the > Connection.connect method. So if you did this > ServerSocket sock = new ServerSocket(80); > Connection.connect(sock); > // whatever .... > sock.close() // terminates the connection ... Okay thank you ... >> Supposed ServerSocket(80) crashes because of any problem, how to get a >> noticed when this event occur? > You would need to write a simple.http.connect.SocketHandler to use with > a Connection object. You can introduce your own functionality to handle > failures. > Niall If I am not mistaken, implementing simple.http.connect.SocketHandler can only be used after the ServerSocket accepts a connection and makes a Socket to handle the connection. But what I want is, to detect whether ServerSocket is still listening/accepting or not. I don't think implementing simple.http.connect.SocketHandler would solve this because the ServerSocket is not accepting a connection (no Socket given to SocketHandler yet). I currently use code like this to check whether ServerSocket is still listening/accepting or not!! new Thread() { public void run() { while(true) { if((!sock.isBound) || sock.isClosed()) { // do something to restart the web server } Thread.sleep(5000); } } } Could you advice me better solution ? Thank you Best Regard, Rahmat Bagas Santoso |
From: Niall G. <nia...@an...> - 2004-05-10 09:28:15
|
Hi, > is it running ServerSocket(80).close() would stop this server cleanly? Not exactly, you need a handle on the ServerSocket given to the Connection.connect method. So if you did this ServerSocket sock = new ServerSocket(80); Connection.connect(sock); // whatever .... sock.close() // terminates the connection ... > Supposed ServerSocket(80) crashes because of any problem, how to get a > noticed when this event occur? You would need to write a simple.http.connect.SocketHandler to use with a Connection object. You can introduce your own functionality to handle failures. Niall |
From: bagas <ba...@in...> - 2004-05-10 07:31:10
|
Hi, Currently I use Simple as simple as this .. Connection webserverConn = ConnectionFactory.getConnection(new HttpMainHandler(), new BufferedPipelineFactory(4096)); webserverConn.connect(new ServerSocket(80)); class HttpMainHandler implements ProtocolHandler { public void handle(Request req, Response resp) { //do something // } } is it running ServerSocket(80).close() would stop this server cleanly? Supposed ServerSocket(80) crashes because of any problem, how to get a noticed when this event occur? Thank you |
From: Niall G. <nia...@an...> - 2004-05-07 08:43:48
|
Hi, > Would you consider adding cleanup functions that enable terminating threads belonging to unused objects? I will probably set all but the simple.http.connect.Processor object as daemon threads. This will ensure that the ServerSocket.close() can act as a means of terminating the server. As for threads in wait() mode I think a ThreadGroup would be easier to manage than kill() methods. Niall |
From: Lars A. <la...@un...> - 2004-05-06 17:06:52
|
Hi, There is a lot of threads created (not only PipelineProcessor and = connection threads). Setting them to daemon solves the application termination problem. If I create a LoaderEngine there is no method to kill the threads it = spawns. I tried to add a kill() on LoaderEngine that called Kill() on = the context.Kill() delegate.Kill(). FileContext.Kill() calls = cache.Kill(). Cache.Kill() calls cleaner.Kill(). CacheCleaner.Kill() and Processor().Kill() sets a alive flag to false. = Unfortunately this did not work as some threads seam to be stuck in a = wait(). A Thread.interupt() solved this problem (don't know if = interrupt() is a good solution...) I did the same for Connection. for (int i =3D 0; i < 50; i++) { LoaderEngine engine =3D new LoaderEngine(); ProtocolHandler handler =3D HandlerFactory.getInstance(engine); Connection connection =3D ConnectionFactory.getConnection(handler); socket =3D new ServerSocket(8282); connection.connect(socket); Thread.sleep(100); socket.close(); UnicastRemoteObject.unexportObject(engine, true); engine.kill(); connection.kill(); } After the modifications the above code will no longer leave junk = threads. Would you consider adding cleanup functions that enable terminating = threads belonging to unused objects? /Lars -----Original Message----- From: Niall Gallagher [mailto:ni...@em...]=20 Sent: den 5 maj 2004 20:25 To: sim...@li... Subject: Re: [Simpleweb-Support] Shutdown Hi, Closing the socket with ServerSocket.close() will terminate all = connection threads for that socket, however this will still leave active = poller threads within the PipelineProcessor active. I have to admit that = this has been overlooked, however you can extend the PipelineProcessor = and terminate all threads within the Vector named active which contains = all active Poller threads. Really the PiplineProcessor threads should be = daemon threads as of Thread.setDaemon(true), ill make sure to include = this fix in the next release. Regards Niall ----- Original Message ----- From: "Lars Arvidson"=20 Date: Wed, 5 May 2004 19:21:48 +0200 To:=20 Subject: [Simpleweb-Support] Shutdown Hi! I tried the code in the getting started tutorial and added a .close() on = the socket hoping it would terminate all threads and make the test = application exit. =A0=A0=A0=A0=A0 public static void main(String[] args) throws Exception = { =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 LoaderEngine engine =3D new = LoaderEngine(); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 engine.load("default", = "test.MainService"); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 engine.link("*", "default"); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ProtocolHandler handler =3D = HandlerFactory.getInstance(engine); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Connection connection =3D = ConnectionFactory.getConnection(handler); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ServerSocket socket =3D new = ServerSocket(8282); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 connection.connect(socket); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Thread.sleep(1000); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 socket.close(); =A0=A0=A0=A0=A0 } This did not terminate the application. I also tied with ProcessQueue.getInstance().stop(). The only way I found to terminate the application was System.exit(). Is there another way to terminate the worker threads? What is the recommended approach to terminate the application? /Lars=20 --=20 ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm ------------------------------------------------------- This SF.Net email is sponsored by Sleepycat Software Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to=20 deliver higher performing products faster, at low TCO. http://www.sleepycat.com/telcomwpreg.php?From=3Dosdnemail3 _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Lars A. <la...@un...> - 2004-05-06 07:42:08
|
Hi, Thanks for the quick reply. To get it to work I had to put setDaemon(true) in following locations: * Constructor of CacheCleaner, Daemon and simple.http.load.Processor. * Init function of PipelineProcessor witch creates simple.http.Processor = threads. To terminate the application: socket.close(); UnicastRemoteObject.unexportObject(engine, true); This should be ok? /Lars -----Original Message----- From: Niall Gallagher [mailto:ni...@em...]=20 Sent: den 5 maj 2004 20:25 To: sim...@li... Subject: Re: [Simpleweb-Support] Shutdown Hi, Closing the socket with ServerSocket.close() will terminate all = connection threads for that socket, however this will still leave active = poller threads within the PipelineProcessor active. I have to admit that = this has been overlooked, however you can extend the PipelineProcessor = and terminate all threads within the Vector named active which contains = all active Poller threads. Really the PiplineProcessor threads should be = daemon threads as of Thread.setDaemon(true), ill make sure to include = this fix in the next release. Regards Niall ----- Original Message ----- From: "Lars Arvidson"=20 Date: Wed, 5 May 2004 19:21:48 +0200 To:=20 Subject: [Simpleweb-Support] Shutdown Hi! I tried the code in the getting started tutorial and added a .close() on = the socket hoping it would terminate all threads and make the test = application exit. =A0=A0=A0=A0=A0 public static void main(String[] args) throws Exception = { =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 LoaderEngine engine =3D new = LoaderEngine(); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 engine.load("default", = "test.MainService"); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 engine.link("*", "default"); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ProtocolHandler handler =3D = HandlerFactory.getInstance(engine); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Connection connection =3D = ConnectionFactory.getConnection(handler); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ServerSocket socket =3D new = ServerSocket(8282); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 connection.connect(socket); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Thread.sleep(1000); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 socket.close(); =A0=A0=A0=A0=A0 } This did not terminate the application. I also tied with ProcessQueue.getInstance().stop(). The only way I found to terminate the application was System.exit(). Is there another way to terminate the worker threads? What is the recommended approach to terminate the application? /Lars=20 --=20 ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm ------------------------------------------------------- This SF.Net email is sponsored by Sleepycat Software Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to=20 deliver higher performing products faster, at low TCO. http://www.sleepycat.com/telcomwpreg.php?From=3Dosdnemail3 _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Niall G. <ni...@em...> - 2004-05-05 18:24:45
|
Hi, Closing the socket with ServerSocket.close() will terminate all connection threads for that socket, however this will still leave active poller threads within the PipelineProcessor active. I have to admit that this has been overlooked, however you can extend the PipelineProcessor and terminate all threads within the Vector named active which contains all active Poller threads. Really the PiplineProcessor threads should be daemon threads as of Thread.setDaemon(true), ill make sure to include this fix in the next release. Regards Niall ----- Original Message ----- From: "Lars Arvidson" Date: Wed, 5 May 2004 19:21:48 +0200 To: Subject: [Simpleweb-Support] Shutdown Hi! I tried the code in the getting started tutorial and added a .close() on the socket hoping it would terminate all threads and make the test application exit. public static void main(String[] args) throws Exception { LoaderEngine engine = new LoaderEngine(); engine.load("default", "test.MainService"); engine.link("*", "default"); ProtocolHandler handler = HandlerFactory.getInstance(engine); Connection connection = ConnectionFactory.getConnection(handler); ServerSocket socket = new ServerSocket(8282); connection.connect(socket); Thread.sleep(1000); socket.close(); } This did not terminate the application. I also tied with ProcessQueue.getInstance().stop(). The only way I found to terminate the application was System.exit(). Is there another way to terminate the worker threads? What is the recommended approach to terminate the application? /Lars -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm |
From: Lars A. <la...@un...> - 2004-05-05 17:21:51
|
Hi! =20 I tried the code in the getting started tutorial and added a .close() on the socket hoping it would terminate all threads and make the test application exit. =20 public static void main(String[] args) throws Exception { LoaderEngine engine =3D new LoaderEngine(); engine.load("default", "test.MainService"); engine.link("*", "default"); ProtocolHandler handler =3D HandlerFactory.getInstance(engine); Connection connection =3D ConnectionFactory.getConnection(handler); ServerSocket socket =3D new ServerSocket(8282); connection.connect(socket); Thread.sleep(1000); socket.close(); } =20 This did not terminate the application. I also tied with ProcessQueue.getInstance().stop(). =20 The only way I found to terminate the application was System.exit(). Is there another way to terminate the worker threads? What is the recommended approach to terminate the application? =20 /Lars=20 |
From: berni <be...@t0...> - 2004-04-29 18:33:52
|
Wow! Thank you very much. This works.... Regards Bernhard ----- Original Message ----- From: "Niall Gallagher" <nia...@an...> To: <sim...@li...> Sent: Tuesday, April 27, 2004 1:36 PM Subject: Re: [Simpleweb-Support] Chat > Hi, > > Yes, this will not work as the java.io.PrintStream class does not throw > exceptions. Instead you can either add the code > > if(out.checkError()) { > System.err.println("The client has closed the connection"); > return; > } > > Or you can wrap the OutputStream in somthing that does propagate > exceptions like the OutputStreamWriter. > > Writer out = new OutputStreamWriter(resp.getOutputStream()); > > Hope this helps. > Niall > > > Hi Niall, > > > > it does not work. > > My Thread just continues forever... > > Here is my updated code: > > > > resp.set("Content-Type", "text/html"); > > resp.set("Connection", "close"); > > // resp.commit(); > > final PrintStream out = resp.getPrintStream(); > > final OutputStream out2 = resp.getOutputStream(); > > out.println("<html><body><h1>Hello Service</h1>"); > > // fill the browser cache > > for (int i = 0; i < 3000; i++) out.print(" "); > > out.print("\n"); > > out.flush(); > > new Thread(new Runnable(){ > > int counter = 0; > > public void run() { > > try { > > while (true) > > { > > out.println("Hello World #" + (++counter) + "<br>"); > > out.flush(); > > System.out.println("PRINTING.."); > > Thread.sleep(1000); > > /*if (counter == 10) > > { > > out.close(); > > break; > > }*/ > > } > > }catch(Exception e){ > > // .... > > e.printStackTrace(System.err); > > } > > } > > }).start(); > > > > Regards > > Bernhard > > > > ----- Original Message ----- > > From: "Niall Gallagher" <nia...@an...> > > To: <sim...@li...> > > Sent: Wednesday, April 21, 2004 12:28 PM > > Subject: Re: [Simpleweb-Support] Chat > > > > > > > Hi, > > > > > > > > > > Is it (technically) possible to get an exception or something if the > > client > > > > stops loading the page? > > > > > > You should be getting an exception from the OutputStream when the client > > > stops loading, you should be getting an IOException from the > > > OutputStream.write or the OutputStream.flush. Let me know if this does > > > not work. > > > > > > Niall > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email is sponsored by: IBM Linux Tutorials > > > Free Linux tutorial presented by Daniel Robbins, President and CEO of > > > GenToo technologies. Learn everything from fundamentals to system > > > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > > > _______________________________________________ > > > Simpleweb-Support mailing list > > > Sim...@li... > > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: IBM Linux Tutorials > > Free Linux tutorial presented by Daniel Robbins, President and CEO of > > GenToo technologies. Learn everything from fundamentals to system > > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > > _______________________________________________ > > Simpleweb-Support mailing list > > Sim...@li... > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek > For a limited time only, get FREE Ground shipping on all orders of $35 > or more. Hurry up and shop folks, this offer expires April 30th! > http://www.thinkgeek.com/freeshipping/?cpg=12297 > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Niall G. <nia...@an...> - 2004-04-29 09:08:52
|
Hi > I have read mamba (http://mambaweb.sourceforge.net) source if I am not > mistaken (please correct me if I am wrong) it only use server > authentication so that the client can verify that the site is who and > what it claims to be. This is true, the SSL/TLS protocol however requires an exchange of keys so the client application must provide its public key. How it provides this key and/or certifies itself is a client specific question. Try looking at the JSSE documentation at http://java.sun.com/products/jsse/. However, I think that client certificates are not really that important. If you think the client might be bogus then use HTTP authentication over SSL to authenticate your users, this is much easier and is supported in the Simple API. Niall |
From: bagas <ba...@in...> - 2004-04-29 01:18:45
|
Thank you for your reply. I have read mamba (http://mambaweb.sourceforge.net) source if I am not mistaken (please correct me if I am wrong) it only use server authentication so that the client can verify that the site is who and what it claims to be. But if the server would like to request a certificate to verify that the client is who and what it claims to be (client authentication) how can I do this? Thank you again, Rahmat Bagas Santoso -----Original Message----- From: sim...@li... [mailto:sim...@li...] On Behalf Of Niall Gallagher Sent: Tuesday, April 27, 2004 4:31 PM To: sim...@li... Subject: Re: [Simpleweb-Support] [newbie] SSL Handshake Hi, I have implemented a basic enough server using Simple, it is located at http://mambaweb.sourceforge.net/, this implements the server with SSL connections. You can find the source for it within the mamba-1.1.jar file. Niall On Tue, 2004-04-27 at 09:09, bagas wrote: > Dear all, > > > > How can I make a web server that needed Client Keystore for making SSL > Handshake process?? > > > > Thank you > > > > > > Rahmat Bagas Santoso. > > ------------------------------------------------------- This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek For a limited time only, get FREE Ground shipping on all orders of $35 or more. Hurry up and shop folks, this offer expires April 30th! http://www.thinkgeek.com/freeshipping/?cpg=12297 _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Niall G. <nia...@an...> - 2004-04-27 11:36:34
|
Hi, Yes, this will not work as the java.io.PrintStream class does not throw exceptions. Instead you can either add the code if(out.checkError()) { System.err.println("The client has closed the connection"); return; } Or you can wrap the OutputStream in somthing that does propagate exceptions like the OutputStreamWriter. Writer out = new OutputStreamWriter(resp.getOutputStream()); Hope this helps. Niall > Hi Niall, > > it does not work. > My Thread just continues forever... > Here is my updated code: > > resp.set("Content-Type", "text/html"); > resp.set("Connection", "close"); > // resp.commit(); > final PrintStream out = resp.getPrintStream(); > final OutputStream out2 = resp.getOutputStream(); > out.println("<html><body><h1>Hello Service</h1>"); > // fill the browser cache > for (int i = 0; i < 3000; i++) out.print(" "); > out.print("\n"); > out.flush(); > new Thread(new Runnable(){ > int counter = 0; > public void run() { > try { > while (true) > { > out.println("Hello World #" + (++counter) + "<br>"); > out.flush(); > System.out.println("PRINTING.."); > Thread.sleep(1000); > /*if (counter == 10) > { > out.close(); > break; > }*/ > } > }catch(Exception e){ > // .... > e.printStackTrace(System.err); > } > } > }).start(); > > Regards > Bernhard > > ----- Original Message ----- > From: "Niall Gallagher" <nia...@an...> > To: <sim...@li...> > Sent: Wednesday, April 21, 2004 12:28 PM > Subject: Re: [Simpleweb-Support] Chat > > > > Hi, > > > > > > > Is it (technically) possible to get an exception or something if the > client > > > stops loading the page? > > > > You should be getting an exception from the OutputStream when the client > > stops loading, you should be getting an IOException from the > > OutputStream.write or the OutputStream.flush. Let me know if this does > > not work. > > > > Niall > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: IBM Linux Tutorials > > Free Linux tutorial presented by Daniel Robbins, President and CEO of > > GenToo technologies. Learn everything from fundamentals to system > > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > > _______________________________________________ > > Simpleweb-Support mailing list > > Sim...@li... > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > |
From: Niall G. <nia...@an...> - 2004-04-27 09:30:42
|
Hi, I have implemented a basic enough server using Simple, it is located at http://mambaweb.sourceforge.net/, this implements the server with SSL connections. You can find the source for it within the mamba-1.1.jar file. Niall On Tue, 2004-04-27 at 09:09, bagas wrote: > Dear all, > > > > How can I make a web server that needed Client Keystore for making SSL > Handshake process?? > > > > Thank you > > > > > > Rahmat Bagas Santoso. > > |
From: bagas <ba...@in...> - 2004-04-27 08:10:28
|
Dear all, How can I make a web server that needed Client Keystore for making SSL Handshake process?? Thank you Rahmat Bagas Santoso. |
From: petite_abeille <pet...@ma...> - 2004-04-26 09:11:42
|
On Apr 26, 2004, at 11:04, bagas wrote: > Is there any class in Simple that encapsulates sending Http msg to a > Http Server ? No. But you could use any one of these: http://jakarta.apache.org/commons/httpclient/ http://www.innovation.ch/java/HTTPClient/ http://java.sun.com/j2se/1.4.2/docs/api/java/net/HttpURLConnection.html Cheers, PA. |
From: bagas <ba...@in...> - 2004-04-26 09:06:34
|
Hi, Is there any class in Simple that encapsulates sending Http msg to a Http Server ? Thanx |