RE: [Simpleweb-Support] How to get noticed when SimpleServergoesdown ...
Brought to you by:
niallg
|
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
|