You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Igor Grigoryev <gr...@gmail.com> on 2007/08/11 01:47:26 UTC
Can I act like client & server simultanously?
Hello,
I'm new to MINA and I need any design recommendations you can provide.
I'm trying to implement data acquisition server that receives data from
GPRS-enabled devices. Those devices maintain persistent TCP connections for
registering, sending requests and some data on server.
The server in turn must have possibility to send configuration commands to
those devices. I'm planing to write GUI administration utility that will
interact with server by RMI or CORBA means to provide administrator with
remote device configuration.
So the question is: "How should I inject request from configuration
utility into specific IoSession associated with specific device?"
As for now I have no other idea than to put IoSessions into global
collection like TreeMap<ClientId,IoSession> after registering on server. And
then use IoSession.write() to inject requests, generated by remote
configuration utility RMI or CORBA call.
Can you advise me with more elegant solution?
--
View this message in context: http://www.nabble.com/Can-I-act-like-client---server-simultanously--tf4251870s16868.html#a12101012
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.
Re: Can I act like client & server simultanously?
Posted by Igor Grigoryev <gr...@gmail.com>.
Trustin Lee wrote:
>
> On 8/11/07, Igor Grigoryev <gr...@gmail.com> wrote:
>>
>> Hello,
>> I'm new to MINA and I need any design recommendations you can provide.
>>
>> I'm trying to implement data acquisition server that receives data from
>> GPRS-enabled devices. Those devices maintain persistent TCP connections
>> for
>> registering, sending requests and some data on server.
>>
>> The server in turn must have possibility to send configuration commands
>> to
>> those devices. I'm planing to write GUI administration utility that will
>> interact with server by RMI or CORBA means to provide administrator with
>> remote device configuration.
>>
>> So the question is: "How should I inject request from configuration
>> utility into specific IoSession associated with specific device?"
>>
>> As for now I have no other idea than to put IoSessions into global
>> collection like TreeMap<ClientId,IoSession> after registering on server.
>> And
>> then use IoSession.write() to inject requests, generated by remote
>> configuration utility RMI or CORBA call.
>>
>> Can you advise me with more elegant solution?
>
> You can also get the set of currently connected sessions by calling
> IoAcceptor.getManagedSessions(). Except that, your approach looks OK
> to me.
>
> HTH,
> Trustin
> --
> what we call human nature is actually human habit
> --
> http://gleamynode.net/
> --
> PGP Key ID: 0x0255ECA6
>
>
OK. Thanks for your answer.
--
View this message in context: http://www.nabble.com/Can-I-act-like-client---server-simultanously--tf4251870s16868.html#a12159956
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.
Re: Can I act like client & server simultanously?
Posted by Trustin Lee <tr...@gmail.com>.
On 8/11/07, Igor Grigoryev <gr...@gmail.com> wrote:
>
> Hello,
> I'm new to MINA and I need any design recommendations you can provide.
>
> I'm trying to implement data acquisition server that receives data from
> GPRS-enabled devices. Those devices maintain persistent TCP connections for
> registering, sending requests and some data on server.
>
> The server in turn must have possibility to send configuration commands to
> those devices. I'm planing to write GUI administration utility that will
> interact with server by RMI or CORBA means to provide administrator with
> remote device configuration.
>
> So the question is: "How should I inject request from configuration
> utility into specific IoSession associated with specific device?"
>
> As for now I have no other idea than to put IoSessions into global
> collection like TreeMap<ClientId,IoSession> after registering on server. And
> then use IoSession.write() to inject requests, generated by remote
> configuration utility RMI or CORBA call.
>
> Can you advise me with more elegant solution?
You can also get the set of currently connected sessions by calling
IoAcceptor.getManagedSessions(). Except that, your approach looks OK
to me.
HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6