You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Trustin Lee (JIRA)" <ji...@apache.org> on 2005/05/17 07:51:05 UTC

[jira] Created: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

SessionManagers should manage list of sessions being managed.
-------------------------------------------------------------

         Key: DIRMINA-42
         URL: http://issues.apache.org/jira/browse/DIRMINA-42
     Project: Directory MINA
        Type: New Feature
    Versions: 0.7    
    Reporter: Trustin Lee
 Assigned to: Trustin Lee 
     Fix For: 0.9


Users are maintaining the list of managed sessions in acceptors and connectors.  It will be much better if MINA can handle this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: [MINA] Short or long messages for IoSession method write(...) ?

Posted by Kaspar Lüthi <ka...@humantools.com>.
hi allesandro

>It looks like you know what I'm speaking of...I didn't spoke of $NickList
<nick1>$$... do you program in DC protocol ?

no i don't work with the DC protocol, sorry i gave you the wrong impression :)
i just used google and searched "Direct Connect Protocol".

you're speaking of $myinfos

"$MyINFO (Client to Server)
Shortly after logging in, the client must send,
    $MyINFO $ALL <nick> <interest>$ $<speed>$<e-mail>$<sharesize>$
The server must pass this message to all users of the hub, including the sender."

i see. it's not as scary as "sending all messages to all users" (exponential
growth of messages), but with many connections (> 1000) this can be a problem
for performance anyway, i think.

with 10000 users connected to the hub, you probably have like 2 logins per
second, which get translated to 2x10000 messages per second, just for $MyINFO.

in my case we had a peak of 650 users, thats like 20000 small out-messages per
*minute*, easy. so your challenges ("problems") don't apply here.


>I send the list containing all connected users (all myinfos) to each
connected user, I don't send a single myInfo to each connected user, so I
think here I'm ok.

i am a bit confused by your description. i think you have 2 cases with $MyINFO:

1. a user connects to the hub. he should receive a complete liste of the users
and ther properties, $MyINFO. -> one big message with all $MyINFO

2. the other, already connected users, need a notification of the new user.
since they already have the current userlist from their logon-process, they
only need the $MyINFO of the new user as an incremental update.

case 1: problem is to maintain the user list and sending it as fast as possible.
but since this only happens once in a users session, it's not #1 priority.

case 2: problem is the number of messages you have to send all the time.
i recommend following: don't send every new $MyINFO to all users. collect them
instead (eventually per user) and send them out in regular intervals. this
could dramatically lower the amount of messages being sent.

you could even make the interval dependent on the numbers of connected users,
many users big interval, few users, small interval.


>I'm here on the HSQLDB...

i still wonder what you store in the DB. does a DC hub needs persistent data
(except blacklists maybe)? if you don't need a persistent storage, don't use
it :) plus you should not spend too much time optimizing the database layer,
if the performance problem happens somewhere else. what makes you sure that
the database is the bottleneck?


>When you write: i maintain user-lists in memory and have them "cached" as a
ByteBuffer. You would mean direct connect hub userlists ?

no just something similar.


>P.S. I use ConcurrentHashMap because I had a lot of
>ConcurrentModificationException or something similar...this is really
thread- safe

i managed to avoid threading on the application level alltogether (after
switching to mina). it was really a relief and simplified the code a lot. i do
threads for some slower tasks, like sending out emails.

if you can give me a look at your code, i might better understand what you
have done and see, if you eventually can get rid of the need for additional
synchronization. i'm just curious. you can contact to me direcly off-list, if
you want.

kaspar


Re: [jira] Commented: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by Srikanth Veeramachaneni <sv...@gmail.com>.
That will work.

thanks,
Srikanth

On 1/3/06, Niklas Therning <ni...@trillian.se> wrote:
> The feature would be enabled by default but you can disable it easily by
> issuing the call IoAcceptor.setDisconnectClientsOnUnbind(false).
>
> /Niklas
>
> Srikanth Veeramachaneni wrote:
> > << I've added code to the VmPipe and Socket transports (inspired by
> > Federico's patch) which keep track of managed sessions and closes all
> > client sessions when unbind() is called.>>
> >
> > Would this feature be optional or would it be the default behavior.
> > The reason I am asking is, I have a requirement that when the
> > server is shutting down, all current sessions need to be sent
> > a message indicating that the server is shutting down and then
> > closed. The way I thought of implementing this is in the following
> > sequence.
> >
> >  1. Unbind all services
> >  2. Process all pending requests
> >  3. Send shutdown message to current sessions
> >  4. Close sessions.
> >
> > So my approach would work only if unbind doesn't close sessions.
> >
> > thanks,
> > Srikanth
>
>

Re: [jira] Commented: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by Niklas Therning <ni...@trillian.se>.
The feature would be enabled by default but you can disable it easily by
issuing the call IoAcceptor.setDisconnectClientsOnUnbind(false).

/Niklas

Srikanth Veeramachaneni wrote:
> << I've added code to the VmPipe and Socket transports (inspired by
> Federico's patch) which keep track of managed sessions and closes all
> client sessions when unbind() is called.>>
> 
> Would this feature be optional or would it be the default behavior.
> The reason I am asking is, I have a requirement that when the
> server is shutting down, all current sessions need to be sent
> a message indicating that the server is shutting down and then
> closed. The way I thought of implementing this is in the following
> sequence.
> 
>  1. Unbind all services
>  2. Process all pending requests
>  3. Send shutdown message to current sessions
>  4. Close sessions.
> 
> So my approach would work only if unbind doesn't close sessions.
> 
> thanks,
> Srikanth


Re: [jira] Commented: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by Srikanth Veeramachaneni <sv...@gmail.com>.
<< I've added code to the VmPipe and Socket transports (inspired by
Federico's patch) which keep track of managed sessions and closes all
client sessions when unbind() is called.>>

Would this feature be optional or would it be the default behavior.
The reason I am asking is, I have a requirement that when the
server is shutting down, all current sessions need to be sent
a message indicating that the server is shutting down and then
closed. The way I thought of implementing this is in the following
sequence.

 1. Unbind all services
 2. Process all pending requests
 3. Send shutdown message to current sessions
 4. Close sessions.

So my approach would work only if unbind doesn't close sessions.

thanks,
Srikanth

On 1/3/06, Niklas Therning (JIRA) <ji...@apache.org> wrote:
>     [ http://issues.apache.org/jira/browse/DIRMINA-42?page=comments#action_12361584 ]
>
> Niklas Therning commented on DIRMINA-42:
> ----------------------------------------
>
> Yes, I can see that an IoSessionGroup could be useful as a kind of broadcast/multicast interface.
>
> But, as I argued in a previous comment I don't think IoAcceptors should return an IoSessionMap when asking for the managed sessions. Why don't we create a new issue for the IoSessionGroup feature?
>
> I'm still working on this issue. It's almost finished and the patch will also solve DIRMINA-93. I've added code to the VmPipe and Socket transports (inspired by Federico's patch) which keep track of managed sessions and closes all client sessions when unbind() is called. What's still missing is the method which returns the managed sessions. I'm thinking of adding
>
> Collection getManagedSessions(SocketAddress)
>
> to IoAcceptor
>
> and
>
> Collection getManagedSessions()
>
> to IoConnector. For now I'm thinking of just copying the internal Set of sessions to a new Set instead of creating some smart collection impl. WDYT?
>
> Note that I haven't done anything for Datagram transport yet. I'm not sure if this issue and DIRMINA-93 are applicable to datagrams?
>
>
> > SessionManagers should manage list of sessions being managed.
> > -------------------------------------------------------------
> >
> >          Key: DIRMINA-42
> >          URL: http://issues.apache.org/jira/browse/DIRMINA-42
> >      Project: Directory MINA
> >         Type: New Feature
> >     Versions: 0.7
> >     Reporter: Trustin Lee
> >     Assignee: Niklas Therning
> >      Fix For: 0.9.1
> >  Attachments: DIRMINA-42.zip
> >
> > Users are maintaining the list of managed sessions in acceptors and connectors.  It will be much better if MINA can handle this.
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators:
>    http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see:
>    http://www.atlassian.com/software/jira
>
>

[jira] Resolved: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by "Niklas Therning (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DIRMINA-42?page=all ]
     
Niklas Therning resolved DIRMINA-42:
------------------------------------

    Resolution: Fixed

Collection getManagedSessions(SocketAddress) has been added to IoAcceptor. SocketAcceptorDelegate as well as VmPipeAcceptor will return the currently connected sessions on the specified local address. DatagramAcceptorDelegate doesn't support this method. It will throw an UnsupportedOperationException.

Note that no support for retrieving the currently  connected sessions on an IoConnector has been added. But if needed it should not be that hard to add that kind of support.


> SessionManagers should manage list of sessions being managed.
> -------------------------------------------------------------
>
>          Key: DIRMINA-42
>          URL: http://issues.apache.org/jira/browse/DIRMINA-42
>      Project: Directory MINA
>         Type: New Feature
>     Versions: 0.7
>     Reporter: Trustin Lee
>     Assignee: Niklas Therning
>      Fix For: 0.9.1
>  Attachments: DIRMINA-42.zip
>
> Users are maintaining the list of managed sessions in acceptors and connectors.  It will be much better if MINA can handle this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by "Niklas Therning (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DIRMINA-42?page=all ]

Niklas Therning reassigned DIRMINA-42:
--------------------------------------

    Assign To: Niklas Therning  (was: Trustin Lee)

> SessionManagers should manage list of sessions being managed.
> -------------------------------------------------------------
>
>          Key: DIRMINA-42
>          URL: http://issues.apache.org/jira/browse/DIRMINA-42
>      Project: Directory MINA
>         Type: New Feature
>     Versions: 0.7
>     Reporter: Trustin Lee
>     Assignee: Niklas Therning
>      Fix For: 0.9.1

>
> Users are maintaining the list of managed sessions in acceptors and connectors.  It will be much better if MINA can handle this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DIRMINA-42?page=comments#action_12361575 ] 

Trustin Lee commented on DIRMINA-42:
------------------------------------

There was an interesting conversation among MINA users that it would be great if MINA provide session grouping.

We could rename IoSessionMap to IoSessionGroup and provide more advance features like that.

> SessionManagers should manage list of sessions being managed.
> -------------------------------------------------------------
>
>          Key: DIRMINA-42
>          URL: http://issues.apache.org/jira/browse/DIRMINA-42
>      Project: Directory MINA
>         Type: New Feature
>     Versions: 0.7
>     Reporter: Trustin Lee
>     Assignee: Niklas Therning
>      Fix For: 0.9.1
>  Attachments: DIRMINA-42.zip
>
> Users are maintaining the list of managed sessions in acceptors and connectors.  It will be much better if MINA can handle this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by "Niklas Therning (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DIRMINA-42?page=comments#action_12360663 ] 

Niklas Therning commented on DIRMINA-42:
----------------------------------------

Ok. I guess all I'm trying to find out is what the key should be in the Map. That would be what your'e storing in the db (your session handle), right?

> SessionManagers should manage list of sessions being managed.
> -------------------------------------------------------------
>
>          Key: DIRMINA-42
>          URL: http://issues.apache.org/jira/browse/DIRMINA-42
>      Project: Directory MINA
>         Type: New Feature
>     Versions: 0.7
>     Reporter: Trustin Lee
>     Assignee: Niklas Therning
>      Fix For: 0.9.1
>  Attachments: DIRMINA-42.zip
>
> Users are maintaining the list of managed sessions in acceptors and connectors.  It will be much better if MINA can handle this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by "Federico Bonelli (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DIRMINA-42?page=comments#action_12360321 ] 

Federico Bonelli commented on DIRMINA-42:
-----------------------------------------

I thought to do IoSessionMap an hashMap container, so we can have put-get-remove methods, considering that put and remove has just to be done 1 time for each IoSession (usually), and get() has to be invoked many more times.

Is that right? whatcan I use as key for that map?
Use the socket address is not a good task for VMPIPE, but what else?

> SessionManagers should manage list of sessions being managed.
> -------------------------------------------------------------
>
>          Key: DIRMINA-42
>          URL: http://issues.apache.org/jira/browse/DIRMINA-42
>      Project: Directory MINA
>         Type: New Feature
>     Versions: 0.7
>     Reporter: Trustin Lee
>     Assignee: Niklas Therning
>      Fix For: 0.9.1

>
> Users are maintaining the list of managed sessions in acceptors and connectors.  It will be much better if MINA can handle this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DIRMINA-42?page=comments#action_12361595 ] 

Trustin Lee commented on DIRMINA-42:
------------------------------------

Exactly. :)

> SessionManagers should manage list of sessions being managed.
> -------------------------------------------------------------
>
>          Key: DIRMINA-42
>          URL: http://issues.apache.org/jira/browse/DIRMINA-42
>      Project: Directory MINA
>         Type: New Feature
>     Versions: 0.7
>     Reporter: Trustin Lee
>     Assignee: Niklas Therning
>      Fix For: 0.9.1
>  Attachments: DIRMINA-42.zip
>
> Users are maintaining the list of managed sessions in acceptors and connectors.  It will be much better if MINA can handle this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by "Niklas Therning (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DIRMINA-42?page=comments#action_12361584 ] 

Niklas Therning commented on DIRMINA-42:
----------------------------------------

Yes, I can see that an IoSessionGroup could be useful as a kind of broadcast/multicast interface.

But, as I argued in a previous comment I don't think IoAcceptors should return an IoSessionMap when asking for the managed sessions. Why don't we create a new issue for the IoSessionGroup feature?

I'm still working on this issue. It's almost finished and the patch will also solve DIRMINA-93. I've added code to the VmPipe and Socket transports (inspired by Federico's patch) which keep track of managed sessions and closes all client sessions when unbind() is called. What's still missing is the method which returns the managed sessions. I'm thinking of adding 

Collection getManagedSessions(SocketAddress)

to IoAcceptor

and

Collection getManagedSessions() 

to IoConnector. For now I'm thinking of just copying the internal Set of sessions to a new Set instead of creating some smart collection impl. WDYT?

Note that I haven't done anything for Datagram transport yet. I'm not sure if this issue and DIRMINA-93 are applicable to datagrams?


> SessionManagers should manage list of sessions being managed.
> -------------------------------------------------------------
>
>          Key: DIRMINA-42
>          URL: http://issues.apache.org/jira/browse/DIRMINA-42
>      Project: Directory MINA
>         Type: New Feature
>     Versions: 0.7
>     Reporter: Trustin Lee
>     Assignee: Niklas Therning
>      Fix For: 0.9.1
>  Attachments: DIRMINA-42.zip
>
> Users are maintaining the list of managed sessions in acceptors and connectors.  It will be much better if MINA can handle this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DIRMINA-42?page=comments#action_12360738 ] 

Trustin Lee commented on DIRMINA-42:
------------------------------------

Creating unmodifiable collection will get very tricky because we'll not be able to iterate it if we wrapped the original collection simply; iteration loop will definitely throw a ConcurrentModificationException.  So we need to compromise here.

1. Create a special data structure which can be iterated without synchronization
2. MINA returns a copy of the collection

I think the first one is the best.  We'll also have to provide a way to synchronize with MINA in case users don't want to see that ghost sessions(which is already closed) are returned.



> SessionManagers should manage list of sessions being managed.
> -------------------------------------------------------------
>
>          Key: DIRMINA-42
>          URL: http://issues.apache.org/jira/browse/DIRMINA-42
>      Project: Directory MINA
>         Type: New Feature
>     Versions: 0.7
>     Reporter: Trustin Lee
>     Assignee: Niklas Therning
>      Fix For: 0.9.1
>  Attachments: DIRMINA-42.zip
>
> Users are maintaining the list of managed sessions in acceptors and connectors.  It will be much better if MINA can handle this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DIRMINA-42?page=all ]

Trustin Lee updated DIRMINA-42:
-------------------------------

    Fix Version: 0.9.1
                     (was: 0.9)

> SessionManagers should manage list of sessions being managed.
> -------------------------------------------------------------
>
>          Key: DIRMINA-42
>          URL: http://issues.apache.org/jira/browse/DIRMINA-42
>      Project: Directory MINA
>         Type: New Feature
>     Versions: 0.7
>     Reporter: Trustin Lee
>     Assignee: Trustin Lee
>      Fix For: 0.9.1

>
> Users are maintaining the list of managed sessions in acceptors and connectors.  It will be much better if MINA can handle this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by "Niklas Therning (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DIRMINA-42?page=comments#action_12360711 ] 

Niklas Therning commented on DIRMINA-42:
----------------------------------------

I've been taking a look at Federico's patch and it looks very promising. As he pointed out it only solves this issue for SocketAcceptors. But it shouldn't be to hard to add this support to VmPipeAcceptors. For DatagramAcceptors I don't think this issue applies?

Then come the IoConnectors. They are IoSessionManagers as well. I think it will be trivial to extend Federico's approach to include SocketConnector.

One thing I still can't figure out though is what the key should be in the IoSessionMap. In the SocketAcceptor case it should probably be the remote address. But that won't work in the SocketConnector case (it's very likely that sessions will be connected to the same remote address). Then it would have to be the local address instead. 

For the VMPIPE transport neither will work without some refactoring.

As pointed out by Federico previously the key is, in most cases, probably protocol specific. Because of that the user will have to maintain some kind of app specific key to socket address string mapping anyway. In Ryan's case he's using a database to maintain this kind of mapping. I don't think it would be too hard on the user if he would have to maintain the mapping to IoSession himself.

What I'm trying to say is that I think it would suffice with a Collection instead of a Map. That would be enough to solve DIRMINA-93. I propose that the method

Collection getManagedSessions(SocketAddress)

is added to IoSessionManager (or at least IoAcceptor to solve DIRMINA-93). The returned collection should be unmodifiable of course. WDYT?


> SessionManagers should manage list of sessions being managed.
> -------------------------------------------------------------
>
>          Key: DIRMINA-42
>          URL: http://issues.apache.org/jira/browse/DIRMINA-42
>      Project: Directory MINA
>         Type: New Feature
>     Versions: 0.7
>     Reporter: Trustin Lee
>     Assignee: Niklas Therning
>      Fix For: 0.9.1
>  Attachments: DIRMINA-42.zip
>
> Users are maintaining the list of managed sessions in acceptors and connectors.  It will be much better if MINA can handle this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by "Niklas Therning (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DIRMINA-42?page=comments#action_12360358 ] 

Niklas Therning commented on DIRMINA-42:
----------------------------------------

I've been thinking a bit about this issue but I can't see why it has to be a Map. Couldn't it just be a Collection? And as Federico points out what would be the key if it's supposed to be a Map?

Federico, are you working on this issue? I was planning to start working on this and DIRMINA-93 but if you want to take care of it, please be my guest. Just let me know.


> SessionManagers should manage list of sessions being managed.
> -------------------------------------------------------------
>
>          Key: DIRMINA-42
>          URL: http://issues.apache.org/jira/browse/DIRMINA-42
>      Project: Directory MINA
>         Type: New Feature
>     Versions: 0.7
>     Reporter: Trustin Lee
>     Assignee: Niklas Therning
>      Fix For: 0.9.1

>
> Users are maintaining the list of managed sessions in acceptors and connectors.  It will be much better if MINA can handle this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by "Niklas Therning (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DIRMINA-42?page=comments#action_12361592 ] 

Niklas Therning commented on DIRMINA-42:
----------------------------------------

:-) I know that I can branch and I will. Was waiting for the repository reorg to be completed. The correct way is to create a personal branch in /directory/sandbox/niklas, right?

> SessionManagers should manage list of sessions being managed.
> -------------------------------------------------------------
>
>          Key: DIRMINA-42
>          URL: http://issues.apache.org/jira/browse/DIRMINA-42
>      Project: Directory MINA
>         Type: New Feature
>     Versions: 0.7
>     Reporter: Trustin Lee
>     Assignee: Niklas Therning
>      Fix For: 0.9.1
>  Attachments: DIRMINA-42.zip
>
> Users are maintaining the list of managed sessions in acceptors and connectors.  It will be much better if MINA can handle this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DIRMINA-42?page=all ]
     
Trustin Lee closed DIRMINA-42:
------------------------------


Looks good.  Great job!

> SessionManagers should manage list of sessions being managed.
> -------------------------------------------------------------
>
>          Key: DIRMINA-42
>          URL: http://issues.apache.org/jira/browse/DIRMINA-42
>      Project: Directory MINA
>         Type: New Feature
>     Versions: 0.7
>     Reporter: Trustin Lee
>     Assignee: Niklas Therning
>      Fix For: 0.9.1
>  Attachments: DIRMINA-42.zip
>
> Users are maintaining the list of managed sessions in acceptors and connectors.  It will be much better if MINA can handle this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by "Niklas Therning (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DIRMINA-42?page=comments#action_12360661 ] 

Niklas Therning commented on DIRMINA-42:
----------------------------------------

You are using UDP right? The session handle in the database is the remote host+port of the client? You would use that handle as a key when querying your DatagramConnector for a previously connected session (from its IoSessionMap)?


> SessionManagers should manage list of sessions being managed.
> -------------------------------------------------------------
>
>          Key: DIRMINA-42
>          URL: http://issues.apache.org/jira/browse/DIRMINA-42
>      Project: Directory MINA
>         Type: New Feature
>     Versions: 0.7
>     Reporter: Trustin Lee
>     Assignee: Niklas Therning
>      Fix For: 0.9.1
>  Attachments: DIRMINA-42.zip
>
> Users are maintaining the list of managed sessions in acceptors and connectors.  It will be much better if MINA can handle this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by "Ryan Rhodes (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DIRMINA-42?page=comments#action_12360664 ] 

Ryan Rhodes commented on DIRMINA-42:
------------------------------------

I think so.  This is all new territory for me, but I think you would fetch a room from the db or the cash, iterate over the other users in the room, possibly filtering the list because some are hidden or invisible or whatever.  So... it seems like I just need to get from the database object that my game logic produced back to the session that mina is holding for me.

> SessionManagers should manage list of sessions being managed.
> -------------------------------------------------------------
>
>          Key: DIRMINA-42
>          URL: http://issues.apache.org/jira/browse/DIRMINA-42
>      Project: Directory MINA
>         Type: New Feature
>     Versions: 0.7
>     Reporter: Trustin Lee
>     Assignee: Niklas Therning
>      Fix For: 0.9.1
>  Attachments: DIRMINA-42.zip
>
> Users are maintaining the list of managed sessions in acceptors and connectors.  It will be much better if MINA can handle this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by "Ryan Rhodes (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DIRMINA-42?page=comments#action_12360662 ] 

Ryan Rhodes commented on DIRMINA-42:
------------------------------------

No, the connection is over TCP.  

> SessionManagers should manage list of sessions being managed.
> -------------------------------------------------------------
>
>          Key: DIRMINA-42
>          URL: http://issues.apache.org/jira/browse/DIRMINA-42
>      Project: Directory MINA
>         Type: New Feature
>     Versions: 0.7
>     Reporter: Trustin Lee
>     Assignee: Niklas Therning
>      Fix For: 0.9.1
>  Attachments: DIRMINA-42.zip
>
> Users are maintaining the list of managed sessions in acceptors and connectors.  It will be much better if MINA can handle this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by "Ryan Rhodes (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DIRMINA-42?page=comments#action_12360660 ] 

Ryan Rhodes commented on DIRMINA-42:
------------------------------------

Speaking for my application, I think MINA needs a Map but that it doesn't need an application specific key.

I would like to use MINA to build a MUD server, which is basically an extended chat server that exists in a coordinate space.  I implemented a simple chat server with MINA for experimenting.

Imagine a user shouts, and you want that to write output to every other user's session, but you don't want it to write output to users that are executing a character creation workflow and are not actually in the game yet.  Image a user says something that should only be output to the users that are standing in the room with him.

I'm thinking that all the contexts that a user's commands will execute under will be game specific contexts that have their own lists of users associated with them, like a room or a set of rooms.  An executing command will navigate the object model from the point of the user it is executing under to some collection of users that it wants to write output to.

In my case these collections will be the result of database queries so I think what I actually need is just to be able to store a handle to a session in the database along with the users object, so that when I need to output to a set of users, I can fetch the session that goes with the user data in the result of my query.  Since there isn't any data associated with the handle I don't think there are any database specific issues related to the key.


> SessionManagers should manage list of sessions being managed.
> -------------------------------------------------------------
>
>          Key: DIRMINA-42
>          URL: http://issues.apache.org/jira/browse/DIRMINA-42
>      Project: Directory MINA
>         Type: New Feature
>     Versions: 0.7
>     Reporter: Trustin Lee
>     Assignee: Niklas Therning
>      Fix For: 0.9.1
>  Attachments: DIRMINA-42.zip
>
> Users are maintaining the list of managed sessions in acceptors and connectors.  It will be much better if MINA can handle this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: [mina] Re: [jira] Commented: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by Niklas Therning <ni...@trillian.se>.
fedechicco@gmail.com wrote:
> I thought many other things about DIRMINA-42:
> -> A single IoAcceptor can manage (and bind/unbind) many
> localSocketAddress, so when we unbind only one of them we have to
> disconnect only the IoSessions correlated to that SocketAddress
> (DIRMINA-93). Because of this is good to mantain a IoSessionMap for each
> binded service in IoAcceptor.

Yes, the IoAcceptors whould definitely need to maintain a Map of
IoSessions with the local address (the port bound to) as key. I'm not
sure if this Map would have to be exposed to others though. Maybe it's
better to have a method with the signature

Collection getSessions(SocketAddress)

in IoAcceptor.

One problem is what to do with IoConnectors. They are IoSessionManagers
as well. In that case it's not as obvious what should be the key in the
Map. I'm not sure if we need IoConnectors to maintain a list of
sessions. Maybe we could skip that for know?

> -> The choice between hashMap or simple collection is interesting, but
> many codes can be developed in the same manner, so i begun to write down
> some interfaces and some patches to mina9.0 code, patching the tcp
> packages especially.

Great!

> May I send that codes on jira? I read something about the Apache
> License, have I to modifie the code, apply some introduction to each class?

Yes of course, please attach the code to the JIRA issue. The coding
conventions used by MINA are described on

http://directory.apache.org/community/process/code-standards.html

I'm not sure if it's 100% up to date. I also have coding style and
formatting files which you can use with Eclipse. I will send them to you
off list.

/Niklas

[mina] Re: [jira] Commented: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by fe...@gmail.com.
I thought many other things about DIRMINA-42:
-> A single IoAcceptor can manage (and bind/unbind) many localSocketAddress, 
so when we unbind only one of them we have to disconnect only the IoSessions 
correlated to that SocketAddress (DIRMINA-93). Because of this is good to 
mantain a IoSessionMap for each binded service in IoAcceptor.
-> The choice between hashMap or simple collection is interesting, but many 
codes can be developed in the same manner, so i begun to write down some 
interfaces and some patches to mina9.0 code, patching the tcp packages 
especially.

May I send that codes on jira? I read something about the Apache License, 
have I to modifie the code, apply some introduction to each class?

Sorry for all that question, Niklas Therning, I hope I do not disturb you 
too much.

by Fedechicco



----- Original Message ----- 
From: "Federico Bonelli (JIRA)" <ji...@apache.org>
To: <de...@directory.apache.org>
Sent: Tuesday, December 13, 2005 11:34 PM
Subject: [jira] Commented: (DIRMINA-42) SessionManagers should manage list 
of sessions being managed.


>    [ 
> http://issues.apache.org/jira/browse/DIRMINA-42?page=comments#action_12360367 ]
>
> Federico Bonelli commented on DIRMINA-42:
> -----------------------------------------
>
> Yes, I planned to work it out because I need to resolve DIRMINA-93 for my 
> applications.
>
> Well, I'd like to work at this, but I'm new to team-development tecnique 
> (I always worked alone), so I need a large amount of tips, i'd like to 
> discuss every single choice.
>
> I was thinking about that, about the hashMap vs Collection, and I don't 
> know. I have many structure that need of a unique identifier that match 
> every single connection, in my applications, but for every application my 
> key is different.
>
> I'm thinking about an ftp server that need of couple nick-ipaddr, about a 
> chat server that need only ipaddr before login, then the nick after login, 
> the neededs of every application is protocol specified...
>
> For mina purpouse only (DIRMINA-93) a collection is all we need, but if we 
> want to make this IoSessionMap usable for the highlevel application we 
> need to develop a userdefinable hashing, pointing to our own collection, 
> or maybe to another parallel mina-useless data structure dedicated for 
> user-usage (that's the goal of DIRMINA-42)
>
> So the key problem is worse then I thougth. What do you think about it?
>
>> SessionManagers should manage list of sessions being managed.
>> -------------------------------------------------------------
>>
>>          Key: DIRMINA-42
>>          URL: http://issues.apache.org/jira/browse/DIRMINA-42
>>      Project: Directory MINA
>>         Type: New Feature
>>     Versions: 0.7
>>     Reporter: Trustin Lee
>>     Assignee: Niklas Therning
>>      Fix For: 0.9.1
>
>>
>> Users are maintaining the list of managed sessions in acceptors and 
>> connectors.  It will be much better if MINA can handle this.
>
> -- 
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators:
>   http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see:
>   http://www.atlassian.com/software/jira
> 


[jira] Commented: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by "Federico Bonelli (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DIRMINA-42?page=comments#action_12360367 ] 

Federico Bonelli commented on DIRMINA-42:
-----------------------------------------

Yes, I planned to work it out because I need to resolve DIRMINA-93 for my applications.

Well, I'd like to work at this, but I'm new to team-development tecnique (I always worked alone), so I need a large amount of tips, i'd like to discuss every single choice.

I was thinking about that, about the hashMap vs Collection, and I don't know. I have many structure that need of a unique identifier that match every single connection, in my applications, but for every application my key is different.

I'm thinking about an ftp server that need of couple nick-ipaddr, about a chat server that need only ipaddr before login, then the nick after login, the neededs of every application is protocol specified...

For mina purpouse only (DIRMINA-93) a collection is all we need, but if we want to make this IoSessionMap usable for the highlevel application we need to develop a userdefinable hashing, pointing to our own collection, or maybe to another parallel mina-useless data structure dedicated for user-usage (that's the goal of DIRMINA-42)

So the key problem is worse then I thougth. What do you think about it?

> SessionManagers should manage list of sessions being managed.
> -------------------------------------------------------------
>
>          Key: DIRMINA-42
>          URL: http://issues.apache.org/jira/browse/DIRMINA-42
>      Project: Directory MINA
>         Type: New Feature
>     Versions: 0.7
>     Reporter: Trustin Lee
>     Assignee: Niklas Therning
>      Fix For: 0.9.1

>
> Users are maintaining the list of managed sessions in acceptors and connectors.  It will be much better if MINA can handle this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by "Federico Bonelli (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DIRMINA-42?page=all ]

Federico Bonelli updated DIRMINA-42:
------------------------------------

    Attachment: DIRMINA-42.zip

I have inserted the first stub of classes and interfaces to resolve DIRMINA-42, the implementation should be completed for the TCP part.

There are many parts of the code that need to be discussed, that's just a stub.

> SessionManagers should manage list of sessions being managed.
> -------------------------------------------------------------
>
>          Key: DIRMINA-42
>          URL: http://issues.apache.org/jira/browse/DIRMINA-42
>      Project: Directory MINA
>         Type: New Feature
>     Versions: 0.7
>     Reporter: Trustin Lee
>     Assignee: Niklas Therning
>      Fix For: 0.9.1
>  Attachments: DIRMINA-42.zip
>
> Users are maintaining the list of managed sessions in acceptors and connectors.  It will be much better if MINA can handle this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIRMINA-42) SessionManagers should manage list of sessions being managed.

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DIRMINA-42?page=comments#action_12361586 ] 

Trustin Lee commented on DIRMINA-42:
------------------------------------

My idea is to provide IoSessionGroup which implements Collection.  I think it is basically same with you.

You're right.  DIRMINA-93 is only for transport types with connections.

BTW you don't need to create a patch; you have karma, why don't you create a branch?

> SessionManagers should manage list of sessions being managed.
> -------------------------------------------------------------
>
>          Key: DIRMINA-42
>          URL: http://issues.apache.org/jira/browse/DIRMINA-42
>      Project: Directory MINA
>         Type: New Feature
>     Versions: 0.7
>     Reporter: Trustin Lee
>     Assignee: Niklas Therning
>      Fix For: 0.9.1
>  Attachments: DIRMINA-42.zip
>
> Users are maintaining the list of managed sessions in acceptors and connectors.  It will be much better if MINA can handle this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira