Client interface to a down-producer

What’s the proper way to interface the client to the down-producer? My
current scheme follows. I’d be interested in knowing if it’s a reasonable
approach, or if there’s a more accepted plan of attack. In particular, I’m
having a problem with slayed clients not being able to unblock. Check the
recent thread on q.p.qnxrtp.os.

Server:
message_attach( dpp, NULL, VN_TX, VN_TX, TxHandler, pHandle);
message_attach( dpp, NULL, VN_RX, VN_RX, RxHandler, pHandle);

Client:
// open connection
coid = open( “/dev/io-net/vn0”, O_RDWR);

// send a packet to the server
struct {
uint16_t type;

} packet = { VN_TX, … };
MsgSend( coid, &packet, sizeof packet, NULL, 0);

// request a packet from the server
uint16_t rxCmd = VN_RX;
MsgSend( coid, &rxCmd, sizeof rxCmd, &packet, sizeof packet);

Thanks,
Shaun

Shaun Jackman <sjackman@nospam.vortek.com> wrote:

What’s the proper way to interface the client to the down-producer? My
current scheme follows. I’d be interested in knowing if it’s a reasonable
approach, or if there’s a more accepted plan of attack. In particular, I’m
having a problem with slayed clients not being able to unblock. Check the
recent thread on q.p.qnxrtp.os.

I would suggest “resmgr_attach(dpp, “/dev/socket/vn”, …)”, will
be more clean.

You can have client do open()/read()/write()/close(), or, if you
don’t like, just have them do open()/devctl()/close().

-xtang

Server:
message_attach( dpp, NULL, VN_TX, VN_TX, TxHandler, pHandle);
message_attach( dpp, NULL, VN_RX, VN_RX, RxHandler, pHandle);

Client:
// open connection
coid = open( “/dev/io-net/vn0”, O_RDWR);

// send a packet to the server
struct {
uint16_t type;

} packet = { VN_TX, … };
MsgSend( coid, &packet, sizeof packet, NULL, 0);

// request a packet from the server
uint16_t rxCmd = VN_RX;
MsgSend( coid, &rxCmd, sizeof rxCmd, &packet, sizeof packet);

Thanks,
Shaun