You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@mina.apache.org by Shiran <sh...@013.net> on 2008/11/24 20:41:07 UTC
Multi client connections
Hi,
I need to write application that open socket connection to
server and send/receive multi requests/responses simultaneously.
Instead of open few socket connections I want to use mina thread
model
IoConnector connector = new
NioSocketConnector(Runtime.getRuntime().availableProcessors() + 1,
Executors.newCachedThreadPool());
I'm not sure how to use it :
"Each SocketAcceptor or SocketConnector creates its own I/O
processor thread(s)" - do I need to handle the threads or just
Call getSession whenever I need to send message ?
Thanks
Shiran.
RE: Multi client connections
Posted by Shiran <sh...@013.net>.
Hi,
I need to write component in our (multi thread) server application that
constantly send and receive messages from /to other server (One server)
Maybe I should use pool of socketConnection and not thread model? or
both?
Thanks
-----Original Message-----
From: Shiran [mailto:shiranlevy@013.net]
Sent: Monday, November 24, 2008 10:50 PM
To: users@mina.apache.org
Subject: RE: Multi client connections
Hi,
Thanks for you response.
Yes I need to connect to one server.
Sorry I didn't understand what do you mean processing of multiple
sessions if I have only one session?
First time using mina and try to find an example .
My application is part of server application that read messages and
sends it to another server (like gateway).
Thanks
-----Original Message-----
From: Emmanuel Lecharny [mailto:elecharny@gmail.com]
Sent: Monday, November 24, 2008 10:08 PM
To: users@mina.apache.org
Subject: Re: Multi client connections
Shiran wrote:
> Hi,
>
Hi,
>
>
> I need to write application that open socket connection to
> server and send/receive multi requests/responses simultaneously.
>
Your client will send/receive multiple reques/response from one server
only ? (assuming this is what you have in mind for the following response)
> Instead of open few socket connections I want to use mina
thread
> model
>
The MINA thread model is just good to handle parallel processing of
multiple sessions (ie, une session = one connexion between a client and
a server). Remember that whatever your thread model will be, at the end,
it goes through _one_ single socket, where everything is processed as in
a queue.
> IoConnector connector = new
> NioSocketConnector(Runtime.getRuntime().availableProcessors() + 1,
> Executors.newCachedThreadPool());
>
>
>
> I'm not sure how to use it :
>
>
>
> "Each SocketAcceptor or SocketConnector creates its own I/O
> processor thread(s)" - do I need to handle the threads or just
>
> Call getSession whenever I need to send message ?
>
What _exactly_ do you want to do ?
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org
__________ NOD32 3575 (20081031) Information __________
This message was checked by NOD32 antivirus system.
http://www.eset.com
__________ NOD32 3575 (20081031) Information __________
This message was checked by NOD32 antivirus system.
http://www.eset.com
RE: Multi client connections
Posted by Shiran <sh...@013.net>.
Hi,
Thanks for you response.
Yes I need to connect to one server.
Sorry I didn't understand what do you mean processing of multiple
sessions if I have only one session?
First time using mina and try to find an example .
My application is part of server application that read messages and
sends it to another server (like gateway).
Thanks
-----Original Message-----
From: Emmanuel Lecharny [mailto:elecharny@gmail.com]
Sent: Monday, November 24, 2008 10:08 PM
To: users@mina.apache.org
Subject: Re: Multi client connections
Shiran wrote:
> Hi,
>
Hi,
>
>
> I need to write application that open socket connection to
> server and send/receive multi requests/responses simultaneously.
>
Your client will send/receive multiple reques/response from one server
only ? (assuming this is what you have in mind for the following response)
> Instead of open few socket connections I want to use mina
thread
> model
>
The MINA thread model is just good to handle parallel processing of
multiple sessions (ie, une session = one connexion between a client and
a server). Remember that whatever your thread model will be, at the end,
it goes through _one_ single socket, where everything is processed as in
a queue.
> IoConnector connector = new
> NioSocketConnector(Runtime.getRuntime().availableProcessors() + 1,
> Executors.newCachedThreadPool());
>
>
>
> I'm not sure how to use it :
>
>
>
> "Each SocketAcceptor or SocketConnector creates its own I/O
> processor thread(s)" - do I need to handle the threads or just
>
> Call getSession whenever I need to send message ?
>
What _exactly_ do you want to do ?
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org
__________ NOD32 3575 (20081031) Information __________
This message was checked by NOD32 antivirus system.
http://www.eset.com
Re: Multi client connections
Posted by Emmanuel Lecharny <el...@gmail.com>.
Shiran wrote:
> Hi,
>
Hi,
>
>
> I need to write application that open socket connection to
> server and send/receive multi requests/responses simultaneously.
>
Your client will send/receive multiple reques/response from one server
only ? (assuming this is what you have in mind for the following response)
> Instead of open few socket connections I want to use mina thread
> model
>
The MINA thread model is just good to handle parallel processing of
multiple sessions (ie, une session = one connexion between a client and
a server). Remember that whatever your thread model will be, at the end,
it goes through _one_ single socket, where everything is processed as in
a queue.
> IoConnector connector = new
> NioSocketConnector(Runtime.getRuntime().availableProcessors() + 1,
> Executors.newCachedThreadPool());
>
>
>
> I'm not sure how to use it :
>
>
>
> "Each SocketAcceptor or SocketConnector creates its own I/O
> processor thread(s)" - do I need to handle the threads or just
>
> Call getSession whenever I need to send message ?
>
What _exactly_ do you want to do ?
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org