?? socketapi.h
字號:
//**********************************************************************
//
// Copyright (C) 2005-2007 Zhang bao yuan(bolidezhang@gmail.com).
// All rights reserved.
//
// This copy of Socketlib is licensed to you under the terms described
// in the LICENSE.txt file included in this distribution.
//
//**********************************************************************
#pragma once
#include "config.h"
namespace SL
{
class SOCKETLIB_API CSocketAPI
{
public:
CSocketAPI(void);
~CSocketAPI(void);
//通過Socket值取得IP地址和Port端口
static bool GetSocketInfo(SOCKET hSocket, LPSTR szIPAddr, USHORT *nPort);
static bool LoadSocketLib(int version_high, int version_low);
static bool UnloadSocketLib();
/*
從windows2000開始引入一個新的I/O控制命令SIO_KEEPALIVE_VALS,可通過WSAIoctl()針對
單個套接字設置是否啟用保活機制、KeepAliveTime、KeepAliveInterval。
Argument structure for SIO_KEEPALIVE_VALS
struct tcp_keepalive {
u_long onoff;
u_long keepalivetime;
u_long keepaliveinterval;
};
*/
static BOOL GetSocketKeepAlive(SOCKET hSocket);
static bool SetSocketKeepAlive(SOCKET hSocket, BOOL bKeepAlive);
static bool SetSocketKeepAliveValue(SOCKET hSocket, unsigned long nKeepAliveTime=7200000, unsigned long nKeepAliveInterval=1000);
//SO_LINGER
static bool SetSocketLinger(SOCKET hSocket, unsigned long nOnoff, unsigned long nLinger);
};
};
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -