You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Leandro Rodrigo Saad Cruz <le...@gmail.com> on 2007/08/12 20:46:40 UTC

Advice for newbie

Hi all.

I started my first project using mina.
I come from a web application background, so my server is always a servlet
container.
I'm seeking for advice on how to implement my first client-server
application.
Here is the scenario.

Many small network enabled devices publish events that are captured on a
centralized server (using mina)
Many client connect to the main server in order to:
1 - send commands to those small devices
2 - be notified when events are generated on them (the same small devices)

I implemented #1 by opening a tcp socket on the client side that serializes
commands using XML/JSON/HESSIAN
and sends them to the server for remote execution.

My question is related to the best way to implement #2.

Should I use mina on the client side, so that the server can connect and
send messages, or
Can I use the same socket I used for #1?

Thanks for your help.

-- 
Leandro Rodrigo Saad Cruz
software developer - certified scrum master
:: scrum.com.br
:: db.apache.org/ojb
:: guara-framework.sf.net
:: xingu.sf.net

Re: Advice for newbie

Posted by Mark <el...@gmail.com>.
I think it would be a cleaner design if you used one socket for your
communications.  There is no reason you could not do this using MINA.


On 8/12/07, Leandro Rodrigo Saad Cruz <le...@gmail.com> wrote:
>
> Hi all.
>
> I started my first project using mina.
> I come from a web application background, so my server is always a servlet
> container.
> I'm seeking for advice on how to implement my first client-server
> application.
> Here is the scenario.
>
> Many small network enabled devices publish events that are captured on a
> centralized server (using mina)
> Many client connect to the main server in order to:
> 1 - send commands to those small devices
> 2 - be notified when events are generated on them (the same small devices)
>
> I implemented #1 by opening a tcp socket on the client side that
> serializes
> commands using XML/JSON/HESSIAN
> and sends them to the server for remote execution.
>
> My question is related to the best way to implement #2.
>
> Should I use mina on the client side, so that the server can connect and
> send messages, or
> Can I use the same socket I used for #1?
>
> Thanks for your help.
>
> --
> Leandro Rodrigo Saad Cruz
> software developer - certified scrum master
> :: scrum.com.br
> :: db.apache.org/ojb
> :: guara-framework.sf.net
> :: xingu.sf.net
>



-- 
..Cheers
Mark

Re: Advice for newbie

Posted by Trustin Lee <tr...@gmail.com>.
On 8/13/07, Leandro Rodrigo Saad Cruz <le...@gmail.com> wrote:
> Hi all.
>
> I started my first project using mina.
> I come from a web application background, so my server is always a servlet
> container.
> I'm seeking for advice on how to implement my first client-server
> application.
> Here is the scenario.
>
> Many small network enabled devices publish events that are captured on a
> centralized server (using mina)
> Many client connect to the main server in order to:
> 1 - send commands to those small devices
> 2 - be notified when events are generated on them (the same small devices)
>
> I implemented #1 by opening a tcp socket on the client side that serializes
> commands using XML/JSON/HESSIAN
> and sends them to the server for remote execution.
>
> My question is related to the best way to implement #2.
>
> Should I use mina on the client side, so that the server can connect and
> send messages, or
> Can I use the same socket I used for #1?

Yes. You don't need to use MINA on the client side.  Server side is enough.

HTH,
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6