You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Sergey Mamitko <sm...@isd.dp.ua> on 2008/06/18 14:40:34 UTC

Bidirectional communication

Hello MINA guru,

I have a question about bidirectional communication.
What I mean it is a connection which will support possibility to send and receive data through one channel.
In other words it should be both client and server in one face. (I don't know if this interpretation is correct from desing part)

I use MINA 1.1.7 for creating TCP communication component and servicemix 3.2.1 as a container.
JDK 1.5
OS: Win XP, Unix

>From servicemix side there should be created component which can acts as a CONSUMER and as a PROVIDER which can switch between these modes.

>From MINA side scenario can looks like:
- TCP client initiates connection
- if connection established then client is ready both:
a) to send requests to server and receive responces (usual approach);
b) to receive requests and responce to server; 

Can you suggest some ideas how to resolve such issues?

-------------------------
Sergey Mamit'ko  smam@isd.dp.ua
ISD

Re: Bidirectional communication

Posted by Sergey Mamitko <sm...@isd.dp.ua>.
Ok
I think next scenario will be much clear:

I have servicemix as a JBI container, TCP binding component and terminal 
server (TS)
TCP BC will have two endpoint for communication with ESB via 
TCPConsumerEndpoint and via TCPProviderEndpoint.
TCP BC will have TCP MINA client for communication with TS.
TCP client always initiates connection to TS and after connection has been 
established to terminal server it can receive data and send acknowledgement 
back to TCP client and further to ESB. But here one trick that terminal 
server can also send data/requests to opened connection (in our case to TCP 
client) and will wait for a response from TCP client.
In other words terminal server can switch between CLIENT and SERVER modes. 
That's why my TCP MINA client also should swith it's modes in order to have 
appropriate communication with TS.

So, question is: is it possible to implement such MINA client part (with 
switched modes) in above scenario using only connectors.
If yes, can you suggest some ideas how to resolve such issues?

Sergey



> On Wed, Jun 18, 2008 at 8:40 AM, Sergey Mamitko <sm...@isd.dp.ua> wrote:
>
>> Hello MINA guru,
>>
>> I have a question about bidirectional communication.
>> What I mean it is a connection which will support possibility to send and
>> receive data through one channel.
>> In other words it should be both client and server in one face. (I don't
>> know if this interpretation is correct from desing part)
>>
>
> Well both endpoints can send back and forth the same requests and 
> responses
> but traditionally the server is the endpoint accepting incoming
> connections.  Are both end points going to act as servers by accepting
> connections?  If so then you're looking at some kind of p2p framework. 
> Need
> more info here.
>
>
>>
>> I use MINA 1.1.7 for creating TCP communication component and servicemix
>> 3.2.1 as a container.
>> JDK 1.5
>> OS: Win XP, Unix
>>
>> From servicemix side there should be created component which can acts as 
>> a
>> CONSUMER and as a PROVIDER which can switch between these modes.
>>
>> From MINA side scenario can looks like:
>> - TCP client initiates connection
>> - if connection established then client is ready both:
>> a) to send requests to server and receive responces (usual approach);
>> b) to receive requests and responce to server;
>>
>> Can you suggest some ideas how to resolve such issues?
>>
>
> Again need more info.  Does your MINA app need to listen for connections 
> or
> is it establishing the connection after which the SMX server sends 
> requests
> to it?
>
> Alex
> 



Re: Bidirectional communication

Posted by Alex Karasulu <ak...@apache.org>.
On Wed, Jun 18, 2008 at 8:40 AM, Sergey Mamitko <sm...@isd.dp.ua> wrote:

> Hello MINA guru,
>
> I have a question about bidirectional communication.
> What I mean it is a connection which will support possibility to send and
> receive data through one channel.
> In other words it should be both client and server in one face. (I don't
> know if this interpretation is correct from desing part)
>

Well both endpoints can send back and forth the same requests and responses
but traditionally the server is the endpoint accepting incoming
connections.  Are both end points going to act as servers by accepting
connections?  If so then you're looking at some kind of p2p framework.  Need
more info here.


>
> I use MINA 1.1.7 for creating TCP communication component and servicemix
> 3.2.1 as a container.
> JDK 1.5
> OS: Win XP, Unix
>
> From servicemix side there should be created component which can acts as a
> CONSUMER and as a PROVIDER which can switch between these modes.
>
> From MINA side scenario can looks like:
> - TCP client initiates connection
> - if connection established then client is ready both:
> a) to send requests to server and receive responces (usual approach);
> b) to receive requests and responce to server;
>
> Can you suggest some ideas how to resolve such issues?
>

Again need more info.  Does your MINA app need to listen for connections or
is it establishing the connection after which the SMX server sends requests
to it?

Alex