/// <summary> /// Lock an async handler on given thread handle and timeout. /// </summary> /// <param name="sameThreadHandle">A handle to a thread</param> /// <param name="timeout">A timeout in milliseconds</param> /// <returns>An async handler if successful; and null or nothing if failed</returns> /// <remarks>You must also call the method Unlock to unlock the handler and its associated socket connection for reuse.</remarks> public virtual THandler Lock(IntPtr sameThreadHandle, uint timeout) { uint poolId; lock (m_cs) { poolId = m_nPoolId; } return(MapToHandler(ClientCoreLoader.LockASocket(poolId, timeout, sameThreadHandle))); }
/// <summary> /// Lock an async handler on a given timeout. /// </summary> /// <param name="timeout">A timeout in milliseconds</param> /// <returns>An async handler if successful; and null or nothing if failed</returns> /// <remarks>You must also call the method Unlock to unlock the handler and its assocaited socket connection for reuse.</remarks> public virtual THandler Lock(uint timeout) { uint poolId; lock (m_cs) { poolId = m_nPoolId; } return(MapToHandler(ClientCoreLoader.LockASocket(poolId, timeout, IntPtr.Zero))); }