예제 #1
0
파일: wolfSSL.cs 프로젝트: dgarske/wolfssl
        /// <summary>
        /// Set the function to use for PSK connections
        /// </summary>
        /// <param name="ctx">pointer to CTX that the function is set in</param>
        /// <param name="psk_cb">PSK function to use</param>
        public static void CTX_set_psk_client_callback(IntPtr ctx, psk_client_delegate psk_cb)
        {
            try
            {
                GCHandle gch = GCHandle.FromIntPtr(ctx);
                ctx_handles handles = (ctx_handles)gch.Target;

                handles.set_psk(GCHandle.Alloc(psk_cb));
                wolfSSL_CTX_set_psk_client_callback(handles.get_ctx(), psk_cb);
            }
            catch (Exception e)
            {
                log(ERROR_LOG, "wolfssl psk client callback error " + e.ToString());
            }
        }
예제 #2
0
파일: wolfSSL.cs 프로젝트: dgarske/wolfssl
 private static extern void wolfSSL_CTX_set_psk_client_callback(IntPtr ctx, psk_client_delegate psk_cb);