directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Wallace <rwall...@thewallacepack.net>
Subject Re: [mina] session.write() in sessionOpened()
Date Wed, 06 Apr 2005 03:12:43 GMT
Richard Wallace wrote:
> Hey guys,
> 
> I'm finally getting a chance to dig back into some of what I was working 
> on in early January with my little mail server.  I'm going through the 
> process of converting what I had over to MINA and it's looking pretty 
> cool.  I am having one problem tho.
> 
> When a mail client connects the first thing I need to do is send a 
> message basically saying, "Hello I'm here".  I figured the place to do 
> this would be in the ProtocolHandler.sessionOpened() implementation with 
> a simple session.write ("220 mydomain.com ESMTP Dropbox");  But when I 
> run it and connect via telnet it doesn't seem as tho the message is sent 
> to the client.  Is this the proper place to do this or is there 
> somewhere more appropriate to send an initial connection message?  Can I 
> send just a String or should I be putting it into a ByteBuffer first?
> 

Alright, turns out I was making a stupid mistake.  I had thought I had 
created a simple pass-thru encoder, but what I forgot to do was actually 
fill in the encode() method with any actual code to pass along the 
message.  So I got that all fixed up and my client is getting messages 
again, yay!

Next question I have is what's the best way to start the services? 
Right now I'm using the SimpleServiceRegistry to start stuff and I 
thought this was great when I started using it cause of how easy it is. 
  But I'm already running into a few limitations, like I can tell the 
services what port to bind on, but I can't tell them what interfaces to 
bind on.  I also can't find a way to determine after binding what 
interfaces actually got bound to.

I can use the lengthier method of actually creating my own 
IoThreadPoolFilter, ProtocolThreadPoolFilter and IoProtocolAcceptor but 
by my nature I'm lazy so I'd rather use a simpler API to do all that for 
me.  Can we add a method or two to the Registry interface that takes 
InetAddress(es) as additional parameters?

Thanks,
Rich

Mime
View raw message