On Thu, Jan 6, 2011 at 5:49 AM, Robert Story <[email protected]> wrote:

> On Tue, 04 Jan 2011 23:07:16 +0100 Magnus wrote:
> MF> What is the correct semantics of a copy of a transport?
> MF>
> MF> What happens if I close the copy? The original?
>
> Good point. One of them will be left with a file descriptor that is no
> longer
> valid. If some other tranport then opens a socket, they could get the same
> one
> and mayhem could ensue.
>
> Maybe a safer thing to do would be to not copy the socket fd, but set it to
> -1
> on the copy. If a particular transport really wants it, they can copy it in
> their f_copy function.
>

Hello Robert,

Are the original transport data structure and its copy modified
independently of each other - if these are ever modified ? If not, a
possible alternative is to use reference counting instead of copying.

Bart.
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to