Hi Jeremy,

On Tue, Jun 10, 2008 at 9:25 PM, Jeremy Fox <[EMAIL PROTECTED]> wrote:

> Hello all,
>
> I am still new to using MINA - I read the tutorials, javadoc, and I've
> combed the mailing list archives, but I did see anything that addresses one
> of my needs on a project.
>
> I need to do alot of asynchronous UDP communications - generally that is
> easy enough, but I not sure how to accomplish what I need to be able to do
> with my IoHandler implementation. I can create an implementation that can
> receive packets from a port, or send a packet back to a sender, and they all
> work great. What I need to be able to do, is to receive any packets that
> come to that port, as well as send a packet to whatever IP is provided when
> a separate thread (JMS consumer or webservice, etc) calls for it.
>

Can you explain this a bit more?  Sounds like you need to communicate with
another UDP server specified by an IP you get from a JMS or webservice
message.


>
> I had initially thought that I could create new sessions to send a new
> packet using my acceptor by calling acceptor.newSession(), but I get an
> error: java.lang.IllegalArgumentException: Unknown local address:
> localhost:1721. I seem to be getting that error no matter how I specify my
> local address. Does anyone have any ideas, or does anyone know of a another
> (preferably better) way to do this?
>

If the UDP endpoint you need to communicate with is an established client to
your UDP server, you may just need to track your sessions and look up the
one to send an unsolicited PDU to.  If that's not the case, and you need to
talk to a UDP service at that IP which you extract from your JMS/web service
message, then you need to use a Connector rather than an Acceptor to access
that service as a client.

HTH,
Alex

Reply via email to