[mina] DatagramAcceptor RFE

View: New views
8 Messages — Rating Filter:   Alert me  

[mina] DatagramAcceptor RFE

by Alban Peignier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

We're working on a Java peer-to-peer API with NAT traversal support.
We're thinking about using the (great) Mina API to control the transport
layer.

http://wiki.tryphon.org/Kolaka_P2PNet
http://wiki.tryphon.org/Kolaka_P2PNet#NAT_Traversal

Everything is fine for us, except a missing feature in the
DatagramAcceptor. Indeed we need to artificially send a response paquet
(when needed) from a DatagramAcceptor. With the JDK APIs, we have the
send methods to perform it. The DatagramAcceptor (logically) doesn't
provide a such thing. But there is no way to extend the DatagramAcceptor
to make it possible.

Can we find a way together to make it possible ?

Regards
--
Alban Peignier <alban.peignier@...>
http://people.tryphon.org/~alban


Re: [mina] DatagramAcceptor RFE

by Trustin Lee :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Alban,

2005/10/15, Alban Peignier <alban.peignier@...>:
We're working on a Java peer-to-peer API with NAT traversal support.
We're thinking about using the (great) Mina API to control the transport
layer.

http://wiki.tryphon.org/Kolaka_P2PNet
http://wiki.tryphon.org/Kolaka_P2PNet#NAT_Traversal

Everything is fine for us, except a missing feature in the
DatagramAcceptor. Indeed we need to artificially send a response paquet
(when needed) from a DatagramAcceptor. With the JDK APIs, we have the
send methods to perform it. The DatagramAcceptor (logically) doesn't
provide a such thing. But there is no way to extend the DatagramAcceptor
to make it possible.

Can we find a way together to make it possible ?

You can use DatagramConnector to send message first before the remote peer send one.

IoConnector connector = new DatagramConnector();
IoSession session = connector.connect( ... );
session.write(...);

Thanks,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/

Re: [mina] DatagramAcceptor RFE

by Alban Peignier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, 2005-10-16 at 09:20 +0900, Trustin Lee wrote:

> You can use DatagramConnector to send message first before the remote
> peer send one.
>
> IoConnector connector = new DatagramConnector();
> IoSession session = connector.connect( ... );
> session.write(...);

But the sent message must have the same source port than the
DatagramAcceptor .. which is already bound. The only way I see is using
the Datagram(Channel|Socket) of the DatagramAcceptor. Is it possible
that the DatagramAdaptor provides a DatagramConnector to create
IOSessions from the same channel/socket ? It may be too complex, in our
use case, we only need to send a packet ..
--
Alban Peignier <alban.peignier@...>
http://people.tryphon.org/~alban


Re: [mina] DatagramAcceptor RFE

by Matteo Merli :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2005/10/16, Alban Peignier <alban.peignier@...>:
> But the sent message must have the same source port than the
> DatagramAcceptor .. which is already bound. The only way I see is using
> the Datagram(Channel|Socket) of the DatagramAcceptor. Is it possible
> that the DatagramAdaptor provides a DatagramConnector to create
> IOSessions from the same channel/socket ? It may be too complex, in our
> use case, we only need to send a packet ..

I have exactly the same kind of problem but haven't found any solutions yet..
I need to listen from several clients on the same UDP port and be able
to send packets to clients from this port..

--
Matteo Merli
<matteo.merli@...>

Re: [mina] DatagramAcceptor RFE

by Trustin Lee :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Matteo and Alban,

I understood your request.  I'll put this issue to JIRA and make MINA 0.9 capable of sending datagram packet to arbitrary address.

Thanks for the heads up,
Trustin

2005/10/16, Matteo Merli <matteo.merli@...>:
2005/10/16, Alban Peignier <alban.peignier@...>:
> But the sent message must have the same source port than the
> DatagramAcceptor .. which is already bound. The only way I see is using
> the Datagram(Channel|Socket) of the DatagramAcceptor. Is it possible
> that the DatagramAdaptor provides a DatagramConnector to create
> IOSessions from the same channel/socket ? It may be too complex, in our
> use case, we only need to send a packet ..

I have exactly the same kind of problem but haven't found any solutions yet..
I need to listen from several clients on the same UDP port and be able
to send packets to clients from this port..

--
Matteo Merli
<matteo.merli@...>



--
what we call human nature is actually human habit
--
http://gleamynode.net/

Re: [mina] DatagramAcceptor RFE

by Trustin Lee :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I put the JIRA issue here:

http://issues.apache.org/jira/browse/DIRMINA-96

Please watch this issue and let me know any idea you've got by commenting there.

Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/

Re: [mina] DatagramAcceptor RFE

by Alban Peignier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Re: [mina] DatagramAcceptor RFE

by Trustin Lee :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This issue has been closed long ago:

http://issues.apache.org/jira/browse/DIRMINA-96

HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/