james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ram C" <ra...@mybc.com>
Subject Re: Update James to use SocketManager?
Date Sun, 04 Mar 2001 19:52:45 GMT
Just wondering what is the best way to do IPFILTERING with the new 'sockets2'
block.

I doesn't look like i can get away with creating a new socket factory
(AuthunticatedServerSocketFactory...or something like that..), seems
to be more of a connection manager issue. (once the accept returns a
client socket, validate against a allow/deny list)

I could probably do this within the 'parsecommand' of the connection
handler. But I will have to reproduce the code in all the handlers which
need this functionality. Is there a better way of doing this?

Is a pipeline of connection handlers a good solution to make it more
generic. The first handler on the pipe does the IPFILTERING and then
passes the socket to the next handler in the pipe and so on...

I need this functionality to prevent innocent attacts on the server (connection
to a production server, when the connection should be really to a test
server)

Cheers,
Ram.

> Peter Donald wrote:
> > 
> > Hi,
> > 
> > I would like to update James to use ConnectionManager/SocketManager
> instead
> > of the SocketServer block. The SocketManager has been deprecated
> for a
> > while and has a number of issues which were fixed via
> > ConnectionManager/SocketManager.
> > 
> > The old system was lossy in certain circumstances - it could leave
> > connections open on errors, or threads running loose. It also did
> not have
> > any notion of shuting down handlers (gracefully or tearing down).
> > 
> > SocketServer was thus broken into two blocks ConnectionManager and
> > SocketManager. I just updated the Avalon CVS with a DefaultHandlerFactory
> > to help manage handlers/factorys to work with ConnectionManager block.
> > Using this allows either graceful shutdown or tear down of handlers
> via
> > methods
> > 
> > void disconnect( String name ) throws Exception;
> > void disconnect( String name, boolean tearDown ) throws Exception;
> > 
> > So the changes will mean that the changes will look something like.
> > 
> > class SMTPServer
> > {
> >    void init()
> >    {
> >       final int port = conf.getChild("port").getValueAsInt( 25 );
> >       final String bindTo = conf.getChild("bind").getValue( "" );
> > 
> >       ServerSocket serverSocket = null;
> > 
> >       if( bindTo.length() > 0 )
> >       {
> >          final InetAddress address = InetAddress.getByName( bindTo
> );
> >          serverSocket = m_socketManager.createServerSocket( port,
> 5,
> > address );
> >       }
> >       else
> >       {
> >          serverSocket = m_socketManager.createServerSocket( port
> );
> >       }
> > 
> >       final ConnectionFactory factory =
> >           new DefaultConnectionFactory( SMTPHandler.class );
> >       m_connectionManager.connect( "SMTP", serverSocket, factory
> );
> >    }
> > }
> > 
> > And the above would act identically as it does now. The main reason
> for
> > this is because I am soon going to remove the code and don't want
> to end up
> > with gump sending a bazillion messages ;)
> > 
> > Cheers,
> > 
> > Pete
> > 
> > *-----------------------------------------------------*
> > | "Faced with the choice between changing one's mind, |
> > | and proving that there is no need to do so - almost |
> > | everyone gets busy on the proof."                   |
> > |              - John Kenneth Galbraith               |
> > *-----------------------------------------------------*
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: james-dev-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-dev-help@jakarta.apache.org
> 
> 

___________________________________________________________
FREE voicemail, email and fax, all in one place.  Sign Up Now! http://www.mybc.com


Mime
View raw message