You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Trustin Lee <tr...@gmail.com> on 2005/07/19 02:13:37 UTC

Re: [MINA] and readiness selection

Hi Bharath,

2005/7/18, Bharath Sundararaman <Bh...@starthis.com>:
> 
> I'm trying to talk to a PLC using MINA via Ethernet/IP protocol. 
> Basically, I need to have a Channel (eg. SocketChannel) which registers with 
> a Selector (called via SocketAcceptor). The Channel is tied to the PLC's IP 
> address and it performs the reads/writes from the PLC. 
> 
> I tried to use SocketAcceptor and SocketConnector to achieve this but the 
> SocketConnector cannot use the 'Session' object which is returned by the 
> 'connect' method to write onto the session. In other words, the 
> SocketConnector (or the channel in my case) cannot initiate the read/write. 
> I am trying to just link the PLC to a channel which registers with a 
> selector via MINA.
> 
You could write messages on a 'sessionOpened' event. If any data is read 
from SocketConnector, you'll get notified by a 'dataRead (or messageReceived 
if you're using Protocol layer)' event.

Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/