// install the fuctions that will be called from libcurlshim private void InstallDelegates() { m_pDelWrite = new External.CURL_WRITE_DELEGATE(WriteDelegate); m_pDelRead = new External.CURL_READ_DELEGATE(ReadDelegate); m_pDelProg = new External.CURL_PROGRESS_DELEGATE(ProgressDelegate); m_pDelDebug = new External.CURL_DEBUG_DELEGATE(DebugDelegate); m_pDelHeader = new External.CURL_HEADER_DELEGATE(HeaderDelegate); m_pDelSSLCtx = new External.CURL_SSL_CTX_DELEGATE(SSLCtxDelegate); m_pDelIoctl = new External.CURL_IOCTL_DELEGATE(IoctlDelegate); m_hThis = GCHandle.Alloc(this); m_ptrThis = (IntPtr)m_hThis; External.curl_shim_install_delegates(m_pCURL, m_ptrThis, m_pDelWrite, m_pDelRead, m_pDelProg, m_pDelDebug, m_pDelHeader, m_pDelSSLCtx, m_pDelIoctl); }