本文整理汇总了C++中Netlib_CloseHandle函数的典型用法代码示例。如果您正苦于以下问题:C++ Netlib_CloseHandle函数的具体用法?C++ Netlib_CloseHandle怎么用?C++ Netlib_CloseHandle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Netlib_CloseHandle函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: s
void MinecraftDynmapProto::SignOffWorker(void*)
{
ScopedLock s(signon_lock_);
SetEvent(events_loop_event_);
m_cookie.clear();
m_title.clear();
m_server.clear();
m_timestamp.clear();
int old_status = m_iStatus;
m_iStatus = ID_STATUS_OFFLINE;
Netlib_Shutdown(hEventsConnection);
OnLeaveChat(NULL, NULL);
delSetting("LogonTS");
ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, m_iStatus);
//SetAllContactStatuses(ID_STATUS_OFFLINE);
//ToggleStatusMenuItems(false);
if (hConnection)
Netlib_CloseHandle(hConnection);
hConnection = NULL;
if (hEventsConnection)
Netlib_CloseHandle(hEventsConnection);
hEventsConnection = NULL;
}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:33,代码来源:communication.cpp
示例2: MSN_FreeGroups
CMsnProto::~CMsnProto()
{
MSN_FreeGroups();
Threads_Uninit();
AvatarQueue_Uninit();
Lists_Uninit();
#ifdef OBSOLETE
DestroyHookableEvent(hMSNNudge);
P2pSessions_Uninit();
MsgQueue_Uninit();
#endif
CachedMsg_Uninit();
Netlib_CloseHandle(m_hNetlibUser);
Netlib_CloseHandle(hNetlibUserHttps);
mir_free(mailsoundname);
mir_free(alertsoundname);
for (int i = 0; i < MSN_NUM_MODES; i++)
mir_free(msnModeMsgs[i]);
mir_free(msnLastStatusMsg);
mir_free(msnPreviousUUX);
mir_free(msnExternalIP);
mir_free(msnRegistration);
mir_free(abCacheKey);
mir_free(sharingCacheKey);
mir_free(storageCacheKey);
mir_free(m_DisplayNameCache);
FreeAuthTokens();
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:34,代码来源:msn_proto.cpp
示例3: TlenWsUninit
void TlenWsUninit(TlenProtocol *proto)
{
if (proto->m_hNetlibUser != NULL) Netlib_CloseHandle(proto->m_hNetlibUser);
if (proto->hFileNetlibUser != NULL) Netlib_CloseHandle(proto->hFileNetlibUser);
proto->m_hNetlibUser = NULL;
proto->hFileNetlibUser = NULL;
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:7,代码来源:tlen_ws.cpp
示例4: handle_entry
bool Omegle_client::stop( )
{
if ( parent->isOffline())
return true;
handle_entry( "stop" );
std::string data = "id=" + this->chat_id_;
http::response resp = flap( OMEGLE_REQUEST_STOP, &data );
if (hConnection)
Netlib_CloseHandle(hConnection);
hConnection = NULL;
if (hEventsConnection)
Netlib_CloseHandle(hEventsConnection);
hEventsConnection = NULL;
if (resp.data == "win") {
return handle_success( "stop" );
} else {
return handle_error( "stop" );
}
/* switch ( resp.code )
{
case HTTP_CODE_OK:
case HTTP_CODE_FOUND:
default:
}*/
}
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:34,代码来源:communication.cpp
示例5: MSN_DebugLog
ThreadData::~ThreadData()
{
if ( s != NULL ) {
MSN_DebugLog( "Closing connection handle %08X", s );
Netlib_CloseHandle( s );
}
if ( mIncomingBoundPort != NULL ) {
Netlib_CloseHandle( mIncomingBoundPort );
}
if ( mMsnFtp != NULL ) {
delete mMsnFtp;
mMsnFtp = NULL;
}
if ( hWaitEvent != INVALID_HANDLE_VALUE )
CloseHandle( hWaitEvent );
p2p_clearDormantSessions();
free( mJoinedContacts );
while (mFirstQueueItem != NULL)
{
TQueueItem* QI = mFirstQueueItem;
mFirstQueueItem = mFirstQueueItem->next;
free(QI);
} }
开发者ID:v998,项目名称:studiokuma,代码行数:29,代码来源:threadmgr.cpp
示例6: MsnRemoveMainMenus
CMsnProto::~CMsnProto()
{
MsnRemoveMainMenus();
DestroyHookableEvent(hMSNNudge);
MSN_FreeGroups();
Threads_Uninit();
MsgQueue_Uninit();
Lists_Uninit();
P2pSessions_Uninit();
CachedMsg_Uninit();
Netlib_CloseHandle(hNetlibUser);
Netlib_CloseHandle(hNetlibUserHttps);
mir_free(mailsoundname);
mir_free(alertsoundname);
mir_free(m_tszUserName);
mir_free(m_szModuleName);
mir_free(m_szProtoName);
for (int i=0; i < MSN_NUM_MODES; i++)
mir_free(msnModeMsgs[i]);
mir_free(msnLastStatusMsg);
mir_free(msnPreviousUUX);
mir_free(msnExternalIP);
mir_free(abCacheKey);
mir_free(sharingCacheKey);
mir_free(storageCacheKey);
FreeAuthTokens();
}
开发者ID:sportarup,项目名称:miranda-dev,代码行数:35,代码来源:msn_proto.cpp
示例7: JabberByteSendConnection
void JabberByteSendConnection( HANDLE hConn, DWORD /*dwRemoteIP*/, void* extra )
{
CJabberProto* ppro = ( CJabberProto* )extra;
TCHAR szPort[8];
JABBER_BYTE_TRANSFER *jbt;
int recvResult, bytesParsed;
HANDLE hListen;
JABBER_LIST_ITEM *item;
char* buffer;
int datalen;
NETLIBCONNINFO connInfo = { sizeof(connInfo) };
CallService(MS_NETLIB_GETCONNECTIONINFO, (WPARAM)hConn, (LPARAM)&connInfo);
mir_sntprintf( szPort, SIZEOF( szPort ), _T("%u"), connInfo.wPort );
ppro->Log( "bytestream_send_connection incoming connection accepted: %s", connInfo.szIpPort );
if (( item = ppro->ListGetItemPtr( LIST_BYTE, szPort )) == NULL ) {
ppro->Log( "No bytestream session is currently active, connection closed." );
Netlib_CloseHandle( hConn );
return;
}
jbt = item->jbt;
if (( buffer = ( char* )mir_alloc( JABBER_NETWORK_BUFFER_SIZE )) == NULL ) {
ppro->Log( "bytestream_send cannot allocate network buffer, connection closed." );
jbt->state = JBT_ERROR;
Netlib_CloseHandle( hConn );
if ( jbt->hEvent != NULL ) SetEvent( jbt->hEvent );
return;
}
hListen = jbt->hConn;
jbt->hConn = hConn;
jbt->state = JBT_INIT;
datalen = 0;
while ( jbt->state!=JBT_DONE && jbt->state!=JBT_ERROR ) {
recvResult = Netlib_Recv( hConn, buffer+datalen, JABBER_NETWORK_BUFFER_SIZE-datalen, 0 );
if ( recvResult <= 0 )
break;
datalen += recvResult;
bytesParsed = ppro->ByteSendParse( hConn, jbt, buffer, datalen );
if ( bytesParsed < datalen )
memmove( buffer, buffer+bytesParsed, datalen-bytesParsed );
datalen -= bytesParsed;
}
if ( jbt->hConn )
Netlib_CloseHandle( jbt->hConn );
ppro->Log( "bytestream_send_connection closing connection" );
jbt->hConn = hListen;
mir_free( buffer );
if ( jbt->hEvent != NULL )
SetEvent( jbt->hEvent );
}
开发者ID:raoergsls,项目名称:miranda,代码行数:59,代码来源:jabber_byte.cpp
示例8: sizeof
void __cdecl CAimProto::aim_avatar_negotiation(void*)
{
HANDLE hServerPacketRecver = (HANDLE)CallService(MS_NETLIB_CREATEPACKETRECVER, (WPARAM)m_hAvatarConn, 2048 * 8);
NETLIBPACKETRECVER packetRecv = { 0 };
packetRecv.cbSize = sizeof(packetRecv);
packetRecv.dwTimeout = 300000;//5 minutes connected
for (;;) {
int recvResult = CallService(MS_NETLIB_GETMOREPACKETS, (WPARAM)hServerPacketRecver, (LPARAM)& packetRecv);
if (recvResult == 0)
break;
if (recvResult == SOCKET_ERROR)
break;
if (recvResult > 0) {
unsigned short flap_length = 0;
for (; packetRecv.bytesUsed < packetRecv.bytesAvailable; packetRecv.bytesUsed = flap_length) {
if (!packetRecv.buffer)
break;
FLAP flap((char*)&packetRecv.buffer[packetRecv.bytesUsed], packetRecv.bytesAvailable - packetRecv.bytesUsed);
if (!flap.len())
break;
flap_length += FLAP_SIZE + flap.len();
if (flap.cmp(0x01)) {
aim_send_cookie(m_hAvatarConn, m_avatar_seqno, AVATAR_COOKIE_LENGTH, AVATAR_COOKIE); // cookie challenge
mir_free(AVATAR_COOKIE);
AVATAR_COOKIE = NULL;
AVATAR_COOKIE_LENGTH = 0;
}
else if (flap.cmp(0x02)) {
SNAC snac(flap.val(), flap.snaclen());
if (snac.cmp(0x0001)) {
snac_supported_families(snac, m_hAvatarConn, m_avatar_seqno);
snac_supported_family_versions(snac, m_hAvatarConn, m_avatar_seqno);
snac_avatar_rate_limitations(snac, m_hAvatarConn, m_avatar_seqno);
snac_error(snac);
}
if (snac.cmp(0x0010)) {
snac_retrieve_avatar(snac);
snac_upload_reply_avatar(snac);
}
}
else if (flap.cmp(0x04))
goto exit;
}
}
}
exit:
Netlib_CloseHandle(hServerPacketRecver);
Netlib_CloseHandle(m_hAvatarConn);
m_hAvatarConn = NULL;
ResetEvent(m_hAvatarEvent);
debugLogA("Avatar Server Connection has ended");
}
开发者ID:ybznek,项目名称:miranda-ng,代码行数:58,代码来源:connection.cpp
示例9: Stop
void Stop()
{
if(ghPacketReciever)
Netlib_CloseHandle(ghPacketReciever);
if(ghConnection)
Netlib_CloseHandle(ghConnection);
if(ghNetlibUser && (ghNetlibUser != INVALID_HANDLE_VALUE))
CallService(MS_NETLIB_SHUTDOWN,(WPARAM)ghNetlibUser,0);
}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:9,代码来源:main.cpp
示例10: Netlib_CloseHandle
TwitterProto::~TwitterProto()
{
twit_.Disconnect();
if (m_hNetlibUser)
Netlib_CloseHandle(m_hNetlibUser);
if (hAvatarNetlib_)
Netlib_CloseHandle(hAvatarNetlib_);
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:9,代码来源:proto.cpp
示例11: ReStart
void ReStart(void *param)
{
if(ghPacketReciever)
Netlib_CloseHandle(ghPacketReciever);
if(ghConnection)
Netlib_CloseHandle(ghConnection);
Sleep(500);
mir_forkthread(&Start, 0);
}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:9,代码来源:main.cpp
示例12: Netlib_CloseHandle
ThreadData::~ThreadData()
{
if (s != NULL) {
proto->debugLogA("Closing connection handle %08X", s);
Netlib_CloseHandle(s);
}
if (mIncomingBoundPort != NULL) {
Netlib_CloseHandle(mIncomingBoundPort);
}
if (mMsnFtp != NULL) {
delete mMsnFtp;
mMsnFtp = NULL;
}
if (hWaitEvent != INVALID_HANDLE_VALUE)
CloseHandle(hWaitEvent);
if (mTimerId != 0)
KillTimer(NULL, mTimerId);
#ifdef OBSOLETE
if (mType == SERVER_SWITCHBOARD) {
for (int i = 0; i < mJoinedContactsWLID.getCount(); ++i) {
const char* wlid = mJoinedContactsWLID[i];
MCONTACT hContact = proto->MSN_HContactFromEmail(wlid);
int temp_status = proto->getWord(hContact, "Status", ID_STATUS_OFFLINE);
if (temp_status == ID_STATUS_INVISIBLE && proto->MSN_GetThreadByContact(wlid) == NULL)
proto->setWord(hContact, "Status", ID_STATUS_OFFLINE);
}
}
#endif
mJoinedContactsWLID.destroy();
mJoinedIdentContactsWLID.destroy();
mir_free(mInitialContactWLID); mInitialContactWLID = NULL;
#ifdef OBSOLETE
const char* wlid = NEWSTR_ALLOCA(mInitialContactWLID);
if (proto && mType == SERVER_P2P_DIRECT)
proto->p2p_clearDormantSessions();
if (wlid != NULL && mType == SERVER_SWITCHBOARD &&
proto->MSN_GetThreadByContact(wlid) == NULL &&
proto->MSN_GetUnconnectedThread(wlid) == NULL) {
proto->MsgQueue_Clear(wlid, true);
}
#endif
mir_free(mData);
}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:54,代码来源:msn_threads.cpp
示例13: Popup_UnregisterClass
FacebookProto::~FacebookProto()
{
// Uninit popup classes
for (std::vector<HANDLE>::size_type i = 0; i < popupClasses.size(); i++)
Popup_UnregisterClass(popupClasses[i]);
popupClasses.clear();
Netlib_CloseHandle(m_hNetlibUser);
WaitForSingleObject(signon_lock_, IGNORE);
WaitForSingleObject(avatar_lock_, IGNORE);
WaitForSingleObject(log_lock_, IGNORE);
WaitForSingleObject(facy.buddies_lock_, IGNORE);
WaitForSingleObject(facy.send_message_lock_, IGNORE);
WaitForSingleObject(facy.notifications_lock_, IGNORE);
WaitForSingleObject(facy.cookies_lock_, IGNORE);
CloseHandle(signon_lock_);
CloseHandle(avatar_lock_);
CloseHandle(log_lock_);
CloseHandle(update_loop_lock_);
CloseHandle(facy.buddies_lock_);
CloseHandle(facy.send_message_lock_);
CloseHandle(facy.fcb_conn_lock_);
CloseHandle(facy.notifications_lock_);
CloseHandle(facy.cookies_lock_);
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:27,代码来源:proto.cpp
示例14: handle_entry
bool facebook_client::logout()
{
if (parent->getByte(FACEBOOK_KEY_DISABLE_LOGOUT, 0))
return true;
handle_entry("logout");
std::string data = "fb_dtsg=" + (!this->dtsg_.empty() ? this->dtsg_ : "0");
data += "&ref=mb&h=" + this->logout_hash_;
http::response resp = flap(REQUEST_LOGOUT, &data);
if (hFcbCon)
Netlib_CloseHandle(hFcbCon);
hFcbCon = NULL;
// Process result
username_ = password_ = self_.user_id = "";
switch (resp.code)
{
case HTTP_CODE_OK:
case HTTP_CODE_FOUND:
return handle_success("logout");
default:
return false; // Logout not finished properly, but..okay, who cares :P
}
}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:29,代码来源:communication.cpp
示例15: handle_entry
bool facebook_client::logout( )
{
if ( DBGetContactSettingByte(NULL, parent->m_szModuleName, FACEBOOK_KEY_DISABLE_LOGOUT, 0) )
return true;
handle_entry( "logout" );
std::string data = "post_form_id=";
data += ( this->post_form_id_.length( ) ) ? this->post_form_id_ : "0";
data += "&fb_dtsg=";
data += ( this->dtsg_.length( ) ) ? this->dtsg_ : "0";
data += "&ref=mb&h=";
data += this->logout_hash_;
http::response resp = flap( FACEBOOK_REQUEST_LOGOUT, &data );
if (hFcbCon)
Netlib_CloseHandle(hFcbCon);
hFcbCon = NULL;
// Process result
username_ = password_ = self_.user_id = "";
switch ( resp.code )
{
case HTTP_CODE_OK:
case HTTP_CODE_FOUND:
return handle_success( "logout" );
default:
return false; // Logout not finished properly, but..okay, who cares :P
}
}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:33,代码来源:communication.cpp
示例16: ptrA
void FacebookProto::StickerAsSmiley(std::string sticker, const std::string &url, MCONTACT hContact)
{
std::string b64 = ptrA(mir_base64_encode((PBYTE)sticker.c_str(), (unsigned)sticker.length()));
b64 = utils::url::encode(b64);
std::tstring filename = GetAvatarFolder() + _T("\\stickers\\");
ptrT dir(mir_tstrdup(filename.c_str()));
filename += (TCHAR*)_A2T(b64.c_str());
filename += _T(".png");
// Check if we have this sticker already and download it it not
if (GetFileAttributes(filename.c_str()) == INVALID_FILE_ATTRIBUTES) {
HANDLE nlc = NULL;
facy.save_url(url, filename, nlc);
Netlib_CloseHandle(nlc);
}
SMADD_CONT cont;
cont.cbSize = sizeof(SMADD_CONT);
cont.hContact = hContact;
cont.type = 0;
cont.path = dir;
CallService(MS_SMILEYADD_LOADCONTACTSMILEYS, 0, (LPARAM)&cont);
}
开发者ID:ybznek,项目名称:miranda-ng,代码行数:26,代码来源:messages.cpp
示例17: SessionClose
void __cdecl SessionClose(mwSession* session)
{
CSametimeProto* proto = (CSametimeProto*)mwSession_getProperty(session, "PROTO_STRUCT_PTR");
proto->debugLog(_T("SessionClose() server_connection=[%d]"), proto->server_connection);
Netlib_CloseHandle(proto->server_connection);
proto->server_connection = 0;
}
开发者ID:martok,项目名称:miranda-ng,代码行数:7,代码来源:sametime_session.cpp
示例18: SmileyDownloadThread
void __cdecl SmileyDownloadThread(void*)
{
bool needext = false;
HANDLE hHttpDwnl = NULL;
WaitForSingleObject(g_hDlMutex, 3000);
while (!Miranda_Terminated() && dlQueue.getCount()) {
ReleaseMutex(g_hDlMutex);
if (_taccess(dlQueue[0].fname.c_str(), 0) != 0) {
InternetDownloadFile(T2A_SM(dlQueue[0].url.c_str()), T2A_SM(dlQueue[0].fname.c_str()), hHttpDwnl);
WaitForSingleObject(g_hDlMutex, 3000);
CMString fname(dlQueue[0].fname);
if (dlQueue[0].needext) { fname += GetImageExt(fname); needext = true; }
_trename(dlQueue[0].fname.c_str(), fname.c_str());
}
else WaitForSingleObject(g_hDlMutex, 3000);
dlQueue.remove(0);
}
dlQueue.destroy();
if (hHttpDwnl) Netlib_CloseHandle(hHttpDwnl);
threadRunning = false;
ReleaseMutex(g_hDlMutex);
if (!Miranda_Terminated()) {
if (needext)
CallServiceSync(MS_SMILEYADD_RELOAD, 0, 0);
else
NotifyEventHooks(hEvent1, 0, 0);
}
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:31,代码来源:download.cpp
示例19: __declspec
extern "C" int __declspec(dllexport) Unload(void)
{
UnhookEvent(hModulesLoaded);
UnhookEvent(hPrebuildContactMenu);
UnhookEvent(hOptionsInit);
if(hWindowEvent != NULL)
UnhookEvent(hWindowEvent);
DestroyServiceFunction(hServiceContactMenu);
Netlib_CloseHandle(g_hNetlibUser);
if(hTabsrmmButtonPressed != NULL)
UnhookEvent(hTabsrmmButtonPressed);
for(int i=0; i < PasteToWeb::pages; ++i)
if(pasteToWebs[i] != NULL) {
delete pasteToWebs[i];
pasteToWebs[i] = NULL;
}
if(Options::instance != NULL) {
delete Options::instance;
Options::instance = NULL;
}
delete contactWindows;
return 0;
}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:27,代码来源:PasteIt.cpp
示例20: __declspec
extern "C" int __declspec(dllexport) Unload(void)
{
ChangeContactStatus(0);
KillTimer(NULL, timerId);
KillTimer(NULL, Countdown);
db_set_b(NULL, MODULENAME, HAS_CRASHED_KEY, 0);
SavewinSettings();
if (hRichEd)
FreeLibrary(hRichEd);
if (hNetlibUser) {
Netlib_CloseHandle(hNetlibUser);
hNetlibUser = NULL;
}
if (hHookDisplayDataAlert)
DestroyHookableEvent(hHookDisplayDataAlert);
if (hHookAlertPopup)
DestroyHookableEvent(hHookAlertPopup);
if (hHookAlertWPopup)
DestroyHookableEvent(hHookAlertWPopup);
if (h_font != NULL)
DeleteObject(h_font);
if (hMenu)
DestroyMenu(hMenu);
WindowList_Destroy(hWindowList);
return 0;
}
开发者ID:kmdtukl,项目名称:miranda-ng,代码行数:31,代码来源:main.cpp
注:本文中的Netlib_CloseHandle函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论