You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Eero Nevalainen <ee...@indagon.com> on 2008/01/03 15:54:38 UTC

Re: Many sockets over single socket

Trustin Lee wrote:
> On Dec 11, 2007 11:51 AM, oscarcs <os...@hotmail.com> wrote:
>> I must develop a system made of nodes in a tree layout. Each node (computer)
>> has many children and only one father.
>>
>> Each node sends TCP messages (using a propietary protocol) to the father, an
>> the father itself must send the messages to the grandfather and so on.
>>
>> I have been using MINA to solve many of the communications concerns, but now
>> i have some doubts.
>>
>> My questions are:
>>
>> 1. Is there a way to simulate at the lowest posible level, many sockets over
>> a single socket?. I mean, using a single socket to send to the grandfather
>> all the messages comming from the children, so i can reuse the procotol
>> logic in all the levels.
> 
> Yes.  MINA is all about an abstract API, so you can implement a
> meta-transport that does what you want.
> 
>> 2. If not, another aproach would be replicate all the child socktets in all
>> the levels, so at the upper level i will end with a single machine with too
>> many sockets. How much is the overhead (in reources or CPU) of using
>> multiple sockets vs. single socket?. Is there any limit?
> 
> I'd suggest you open as many sockets as the number of cores of your
> machine at least, and each socket could host multiple sockets.  If you
> can implement a virtual socket, then it shouldn't be that difficult to
> implement.
> 
> It would be really a great addition to MiNA project if such a facility
> is provided out of the box.

Hmm, this sounds very much like SCTP or like BEEP channels. beep4j 
builds on MINA so it might have something similar already implemented.

-Eero