本文整理汇总了C++中Netlib_CloseHandle函数的典型用法代码示例。如果您正苦于以下问题:C++ Netlib_CloseHandle函数的具体用法?C++ Netlib_CloseHandle怎么用?C++ Netlib_CloseHandle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Netlib_CloseHandle函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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();
}
示例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;
}
示例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:
}*/
}
示例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);
} }
示例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();
}
示例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 );
}
示例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");
}
示例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);
}
示例10: Netlib_CloseHandle
TwitterProto::~TwitterProto()
{
twit_.Disconnect();
if (m_hNetlibUser)
Netlib_CloseHandle(m_hNetlibUser);
if (hAvatarNetlib_)
Netlib_CloseHandle(hAvatarNetlib_);
}
示例11: ReStart
void ReStart(void *param)
{
if(ghPacketReciever)
Netlib_CloseHandle(ghPacketReciever);
if(ghConnection)
Netlib_CloseHandle(ghConnection);
Sleep(500);
mir_forkthread(&Start, 0);
}
示例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);
}
示例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_);
}
示例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
}
}
示例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
}
}