📄 timeoutsocket.h
字号:
//////////////////////////////////////////////////////////////////////
// FileFury
// Copyright (c) 2000 Tenebril Incorporated
// All rights reserved.
//
// This source code is governed by the Tenebril open source
// license (http://www.tenebril.com/developers/opensource/license.html)
//
// For more information on this and other open source applications,
// visit the Tenebril OpenSource page:
// http://www.tenebril.com/developers/opensource
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#ifndef TIMEOUTSOCKET_INCLUDE
#define TIMEOUTSOCKET_INCLUDE
#define TIMEOUTSOCKET_USING
#define MAX_CONNECT_RETRIES 10
class CTimeoutSocket : public CSocket
{
public:
BOOL Connect( LPCTSTR lpszHostAddress, UINT nHostPort );
int ReceiveFull(void *lpBuf, int nBufLen, int nFlags = 0);
CTimeoutSocket() {m_nTimerID = 0;}
BOOL SetTimeout(UINT uTimeOut);
BOOL KillTimeout();
protected:
#ifdef TIMEOUTSOCKET_USING
virtual BOOL OnMessagePending();
BOOL ConnectHelper(const SOCKADDR* lpSockAddr, int nSockAddrLen);
#endif
private:
int m_nTimerID;
int Timeout;
CTime StartTime;
CTimeSpan TimeSpan;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -