[ http://issues.apache.org/jira/browse/DIRMINA-165?page=comments#action_12370052 ]
Trustin Lee commented on DIRMINA-165: ------------------------------------- It's hard to duplicate buffers safely with autoExpand. There are two solutions AFAIK: * Force 'autoExpand' property to be 'false' always, once duplication is invoked. In this workaround, reference count is shared among the original buffer and the derived ones. It becomes hard to detect wrong number of releases spreaded over multiple duplicate buffers. * Force both 'pooled' and 'autoExpand' property to be 'false' always, once duplication is invoked. In this workaround, there's no need to manage a referemce count at all. > Easy and performant copy of the ByteBuffer > ------------------------------------------ > > Key: DIRMINA-165 > URL: http://issues.apache.org/jira/browse/DIRMINA-165 > Project: Directory MINA > Type: Improvement > Versions: 0.9, 0.8.2, 0.8.1, 0.8 > Reporter: Federico Bonelli > Priority: Minor > Fix For: 0.9.3 > Attachments: ByteBuffer.java, HubServer_broadCastTCPmessages.zip > > Until now if you wish to broadcast a message you must create by your own the > bytebuffer copies, it would be better to provide a ByteBuffer.asReadOnly() > method that create a copy that share the data with the original ByteBuffer -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
