Skip navigation.
Home
The QNX Community Portal

View topic - Wait on TCP/IP connection and other proxy

Wait on TCP/IP connection and other proxy

For the old QNX2 and QNX4 RTOS

Wait on TCP/IP connection and other proxy

Postby tommym121 » Tue Feb 09, 2010 4:15 pm

I am creating an application under QNX 4.25 that uses Receive(0, ...) to wait on a proxy, yet I need to create a thread that will uses TCP/IP SOCK_STREAM to deliver data to a client application in linux/windows world.

My application is served as a bridge to bring data for native QNX messaging (using queue) to get data from the old database and allow clients application using TCP/IP to query data it needs from the bridge.

Is that feasible? Can I have the Receive(proxy_id_from_queue, ...) to handle the old database while have Select() within a thread to handle TCP/IP client request?
tommym121
New Member
 
Posts: 7
Joined: Wed Aug 05, 2009 6:01 pm

RE: Wait on TCP/IP connection and other proxy

Postby mario » Tue Feb 09, 2010 4:58 pm

In theory yes, but threads and QNX4 are not real friend. I suggest you make every effort to avoid it.

I would write a separate program. Or just use a single thread and do the select and receive at the same time. Check the documentation on select, it will talk about _select_receive(). I've used this with success in the past.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

RE: Wait on TCP/IP connection and other proxy

Postby tommym121 » Tue Feb 09, 2010 5:44 pm

What will be the best way to share the memory space between 32-bit processes?

And what kind of thread issue in QNX 4.25. Just curious?
tommym121
New Member
 
Posts: 7
Joined: Wed Aug 05, 2009 6:01 pm

RE: Wait on TCP/IP connection and other proxy

Postby mario » Tue Feb 09, 2010 6:20 pm

Check out mmap() for sharing memory, but why not used messages?

As for thread, it is just not officially supported and is more of a kludge.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

RE: Wait on TCP/IP connection and other proxy

Postby tommym121 » Tue Feb 09, 2010 6:52 pm

Thanks.
tommym121
New Member
 
Posts: 7
Joined: Wed Aug 05, 2009 6:01 pm

RE: Wait on TCP/IP connection and other proxy

Postby MSchneider » Thu Feb 11, 2010 4:25 pm

Regarding threads in Qnx4. Several years ago, we had an application that used threads in Qnx4. I don't remember the details, but I think the threads weren't true threads because they were implemented by using separate processes.
MSchneider
Active Member
 
Posts: 27
Joined: Wed May 28, 2003 6:19 pm


Return to QNX2 and QNX4

Who is online

Users browsing this forum: No registered users and 3 guests