Ahhh,

Your handler will always have a single session hook. I think of the session as a parallel to the fd. If the fact that no threads per connection are spawned, what kind of Executor did you use ? How and where do you close your stream ? Is the the fact that when you closes the socket you kill both connection is the reason you assume you have a single stream ? Some small pieces of code would help also to see what could be wrong ...

    I'm just trying to help here ...
    Patrick S.


On 27/05/2009 9:28 AM, Pietro Guerrieri wrote:
my problem is that if i have two concurrently stream tcp, MINA open one
session for the two stream.
in the handler there is only one session open for the two tcp stream.
I know that  i did something wrong, but i don't know where, if is in the
handler or in the codec.

On Wed, May 27, 2009 at 3:21 PM, Patrick Sansoucy<
[email protected]>  wrote:

I am sorry about the misperception, but I was not doing any humor ...The
links from Sun I provided explain exactly the basis of what you are
querying. Take the time to consult them. Once those notions are understood,
use Mina, it wraps those notion into a tidy and easy to use framework. By
reading the examples on the Mina site (which are pretty good and
comprehensive, having used them myself), you should be able to do what you
want to using Mina and all it's added benefits.

Patrick S.

On Wed, May 27, 2009 at 9:14 AM, Pietro Guerrieri<[email protected]
wrote:
Hi Patrick,

thanks for your humor.

I have no words for your reply... if you do not know what to say, don't
say.


On Wed, May 27, 2009 at 3:02 PM, Patrick Sansoucy<
[email protected]>  wrote:

Hi Pietro,

    This is basic socket programming, your listen socket is not 'binded'
directly to the client. It spawns another independent file descriptor
to
handle the TCP traffic. Thus each 'connection' is independent from each
other. An example like this one could help a bit ...



http://java.sun.com/docs/books/tutorial/networking/sockets/clientServer.html
This also might help


http://java.sun.com/developer/onlineTraining/Programming/BasicJava2/socket.html
    It's basic Java, but Mina is "just" a wrapper over the socket
protocol
(NIO to be exact).

  Patrick S.


On 27/05/2009 8:11 AM, Pietro Guerrieri wrote:

have you a right example for manage session?

On Wed, May 27, 2009 at 1:28 PM, Alexander Christian<[email protected]>
  wrote:



On Wed, 27 May 2009 12:54:43 +0200, Pietro Guerrieri
<[email protected]>
wrote:


i did some test
ad i have e problem/mistake.

i explain:
i have one server and two clients.

in order:
client1 send 1000 messages to server
client2 send 10 messages to server

server receive messages from client1
server receive messages from client2
client2 end message
server close all connection
client1 have still message to send

how i can resolve this sessionClose!?!?!?



Why does the server close all connection? As each client has it's own
session, it doesn't matter if session2 has been closen ... session1
for
client1 should still be open and valid. if not, you did something
wrong.
- Alex






Reply via email to