Dave Nickerson
|
Re: Caching of _msg_info.scoid.
|
Dave Nickerson
04/29/2016 3:39 PM
post116191
|
Re: Caching of _msg_info.scoid.
>
> We assume the following regarding the scoid value:
> - As connections are attached to, and detached from, the channel, a new
> connection will not have a previously used scoid associated with it.
The SCOID values should be re-used as soon as the client associated with it no longer has any CONNECTIONS.
Depending on flags set during the ChannelCreate(), specifically if _NTO_CHF_DISCONNECT is set, then SCOID are required
to be freed by calling ConnectDetach(scoid) once you are done freeing up any lists associated with the scoid, in your
case the state information you are keeping about each client. Once the scoid has been freed, the scoid will be
available for re-use.
> - The scoid is never re-assigned while connections are attached. That is if
> Client1 performs a ConnectAttach(...) to the server, then every time a message
> is received from Client1 the scoid will always be the same, regardless of how
> many other clients perform ConnectAttach( ... ), Send( ...) ConnectDetach( .
> .. ).
This is true.
>
> Please let me know if the above assumptions are valid and what is the
> behaviour of QNX regarding assignment and re-use of scoids.
>
> In addition, suppose that the client is multi-threaded, and each thread
> performs ConnectAttach( ...) then Send (... ). In the server, when the message
> from each thread is received, will a different scoid be associated with each
> thread?
The scoid uniquely identifies a client attached to a server. As long as the client has a valid connection, (and thus a
scoid), other threads within the client process calling ConnectAttach() will not generate a new scoid.
|
|
|