Home
Support

Knowledge Base

BSPs and drivers
Community resources
Product documentation
Questions?
Contact us

Creation of channel connection
 
________________________________________________________________________

Applicable Environment
________________________________________________________________________
  • Topic: Creation of channel connection
  • SDP: 6.4.1
  • Target: Any supported target
________________________________________________________________________

Question
________________________________________________________________________

I have a single-threaded process which creates a channel and then registers it with gns via name_open(). Now I need to create a connection to the channel from the same process. I have not been able to do this. When I call name_open() the call hangs indefinitely. When I try to use ConnectAttach() I get error ESRCH back. Why does ConnectAttach() hang?

________________________________________________________________________

Solution
________________________________________________________________________

The problem with the test case is that upon connecting to yourself (server calls name_open in the name it just attached) you must be able to receive and reply to the IO_CONNECT message that is generated by the connection attempt.

The resmgr framework sends the IO_CONNECT message to the server as per the documentation for name_open:
In the past, when an application used name_open() to connect to a service, the server wasn't notified. Now, an _IO_CONNECT message with a subtype of _IO_CONNECT_OPEN is sent to the server. The server application must be able handle this message. For an example, see the documentation for name_attach().

Your server must be able to call MsgReceive to get that message AND respond to it (MsgReply or MsgError). The way you've written your program necessitates multiple threads - this won't be possible with just one thread.

________________________________________________________________________
NOTE: This entry has been validated against the SDP version listed above. Use caution when considering this advice for any other SDP version. For supported releases, please reach out to QNX Technical Support if you have any questions/concerns.
________________________________________________________________________


Related Attachments
 None Found





Please contact us with your questions or concerns.