Skip to content

增加UDP Agent #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 81 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
070771e
HP-Socket v 3.1.1
ldcsaa Dec 24, 2013
a11bde2
Merge branch 'master' of github.com:ldcsaa/HP-Socket
ldcsaa Dec 24, 2013
b47b51e
HP-Socket v3.1.1 Released
ldcsaa Dec 24, 2013
a634d16
Merge branch 'master' of github.com:ldcsaa/HP-Socket
ldcsaa Dec 24, 2013
b32bd41
Merge branch 'master' of github.com:ldcsaa/HP-Socket
ldcsaa Dec 24, 2013
be8bfc8
Merge branch 'master' of github.com:ldcsaa/HP-Socket
ldcsaa Jan 13, 2014
e599eb9
Merge branch 'master' of github.com:ldcsaa/HP-Socket
ldcsaa Dec 24, 2013
d9d1271
Merge branch 'master' of github.com:ldcsaa/HP-Socket
ldcsaa Dec 24, 2013
5dc9362
Merge branch 'master' of github.com:ldcsaa/HP-Socket
ldcsaa Dec 24, 2013
5ee0c2a
Merge branch 'master' of github.com:ldcsaa/HP-Socket
ldcsaa Jan 14, 2014
5612564
HP-Socket v3.1.3
ldcsaa Mar 29, 2014
6447166
Merge branch 'master' of github.com:ldcsaa/HP-Socket
ldcsaa Mar 29, 2014
83eef40
clear old other language demo
ldcsaa Apr 17, 2014
0bedf04
0417
ldcsaa Apr 17, 2014
d7c3d00
0407
ldcsaa Apr 17, 2014
b81e191
0417
ldcsaa Apr 17, 2014
7b7d7f6
0417
ldcsaa Apr 17, 2014
6e8b82d
20140427
ldcsaa Apr 26, 2014
0660e92
20140427
ldcsaa Apr 26, 2014
91e7108
20140427
ldcsaa Apr 26, 2014
55489c2
20140427
ldcsaa Apr 26, 2014
4fcd78e
20140427
ldcsaa Apr 26, 2014
4d35e50
20140427
ldcsaa Apr 26, 2014
660e980
20040427
ldcsaa Apr 27, 2014
6f7595b
20040427
ldcsaa Apr 27, 2014
078861c
20140428
ldcsaa Apr 28, 2014
dee1c00
20140507
ldcsaa May 6, 2014
d07938e
delete
ldcsaa May 11, 2014
5d1ba7d
20140511
ldcsaa May 11, 2014
bbab911
20140511
ldcsaa May 11, 2014
474885c
20140526
ldcsaa May 25, 2014
c171507
20140604
ldcsaa Jun 4, 2014
96032d0
20140604
ldcsaa Jun 4, 2014
6b0e640
20140604
ldcsaa Jun 6, 2014
d731b01
20140707
ldcsaa Jul 6, 2014
d2c5ea3
20140707
ldcsaa Jul 6, 2014
d6251b0
20140707
ldcsaa Jul 7, 2014
d3e903a
20140708
ldcsaa Jul 8, 2014
20d5bca
20140708
ldcsaa Jul 8, 2014
0c478d0
20140812
ldcsaa Aug 12, 2014
455edce
20140812
ldcsaa Aug 12, 2014
2f89905
20140812
ldcsaa Aug 12, 2014
919a6c3
20140812
ldcsaa Aug 13, 2014
668dd66
20140812
ldcsaa Aug 13, 2014
9a2f863
20140812
ldcsaa Aug 13, 2014
c724890
20140812
ldcsaa Aug 13, 2014
1019f46
20141208
ldcsaa Dec 7, 2014
b95bb5f
20141208
ldcsaa Dec 7, 2014
534126a
20141208
ldcsaa Dec 7, 2014
34f9fe3
20141208
ldcsaa Dec 8, 2014
975112d
20141227
ldcsaa Dec 27, 2014
37f51ff
20141227
ldcsaa Dec 28, 2014
193f979
20150125
ldcsaa Jan 25, 2015
a46b530
20151028
ldcsaa Jan 28, 2015
2cdb396
20150129
ldcsaa Jan 29, 2015
21412dc
20150202
ldcsaa Feb 2, 2015
08fa5ca
20150203
ldcsaa Feb 3, 2015
cf7d517
20150205
ldcsaa Feb 5, 2015
a1207e2
20150209
ldcsaa Feb 9, 2015
e14ed68
20151130
Nov 30, 2015
74f6824
20151130
Nov 30, 2015
ded870d
20151130
Nov 30, 2015
c4eba2d
20151201
Dec 1, 2015
6476ca2
20160327
ldcsaa Mar 27, 2016
8bbd5be
20160327
ldcsaa Mar 27, 2016
005e154
20160401
ldcsaa Mar 31, 2016
6c78a87
20160402
ldcsaa Apr 1, 2016
1106c9c
20160409
Apr 9, 2016
587689c
20160409
Apr 9, 2016
5f312bc
20160409
Apr 9, 2016
5c46195
20160409
ldcsaa Apr 9, 2016
e3f2803
20160410
ldcsaa Apr 9, 2016
b615862
20160420
Apr 20, 2016
df83997
20160420
Apr 20, 2016
198c03e
20160421
Apr 21, 2016
0b211d4
20160421
Apr 21, 2016
7450e29
20160421
Apr 21, 2016
498460d
20160421
Apr 21, 2016
b77aee1
20160421
ldcsaa Apr 21, 2016
b78174e
1. added UDP Agent support.
hezlog Apr 25, 2016
6c4c72e
1.修正 UDP Agent 接口;
hezlog Apr 28, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
20141227
  • Loading branch information
ldcsaa committed Dec 27, 2014
commit 975112db62098e66c658df3661c8ee72fa107151
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Compiled Object files
# Compiled Object files
*.slo
*.lo
*.o
Expand Down
7 changes: 6 additions & 1 deletion ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ v3.3.1
3��IPullSocket �� IPullClient �ӿ����� Peek() �������ڿ�̽���������ݣ������Ƴ����������ݣ�
4������ IComplexSocketListener �������ӿڣ����� Server/Agent ����ļ��������ӿ�
5��IComplexSocketListener �ṩ OnShutdown ֪ͨ����ȡ�� Server/Agent ���ԭ���� OnServerShutdown/OnAgentShutdown
6��IClient������� Get/SetExtra() �������ڱ����Զ��帽������
6��IClient ������� Get/SetExtra() �������ڱ����Զ��帽������
7��IServer �� IAgent ������ӡ���Ĭ���Ӵ�������ط�����
1) DisconnectSilenceConnections()���Ͽ�����ָ��ʱ���ľ�Ĭ����
2) GetSilencePeriod()����ȡij�����Ӿ�Ĭʱ�䣨���룩
3) SetMarkSilence()�������Ƿ��Ǿ�Ĭʱ�䣨����Ϊ TRUE ʱ DisconnectSilenceConnections() �� GetSilencePeriod() ����Ч��Ĭ�ϣ�FALSE��
4) IsMarkSilence()������Ƿ��Ǿ�Ĭʱ��

> ���� UdpCast ͨ�������
-----------------
Expand Down
Binary file modified Doc/HP-Socket Class Diagram - v3.3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,019 changes: 668 additions & 351 deletions Doc/HP-Socket Class Diagram - v3.3.uml

Large diffs are not rendered by default.

25 changes: 21 additions & 4 deletions HP-Socket/Bin/HPSocket/SocketInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ class IComplexSocket
* ����ֵ�� TRUE -- �ɹ�
* FALSE -- ʧ�ܣ���ͨ�� Windows API ���� ::GetLastError() ��ȡ Windows �������
*/
virtual BOOL SendPackets(CONNID dwConnID, const WSABUF pBuffers[], int iCount) = 0;
virtual BOOL SendPackets(CONNID dwConnID, const WSABUF pBuffers[], int iCount) = 0;

/*
* ���ƣ��Ͽ�����
Expand All @@ -615,7 +615,7 @@ class IComplexSocket
* ����ֵ�� TRUE -- �ɹ�
* FALSE -- ʧ��
*/
virtual BOOL Disconnect(CONNID dwConnID, BOOL bForce = TRUE) = 0;
virtual BOOL Disconnect(CONNID dwConnID, BOOL bForce = TRUE) = 0;

/*
* ���ƣ��Ͽ���ʱ����
Expand All @@ -626,7 +626,18 @@ class IComplexSocket
* ����ֵ�� TRUE -- �ɹ�
* FALSE -- ʧ��
*/
virtual BOOL DisconnectLongConnections(DWORD dwPeriod, BOOL bForce = TRUE) = 0;
virtual BOOL DisconnectLongConnections(DWORD dwPeriod, BOOL bForce = TRUE) = 0;

/*
* ���ƣ��Ͽ���Ĭ����
* �������Ͽ�����ָ��ʱ���ľ�Ĭ����
*
* ������ dwPeriod -- ʱ�������룩
* bForce -- �Ƿ�ǿ�ƶϿ�����
* ����ֵ�� TRUE -- �ɹ�
* FALSE -- ʧ��
*/
virtual BOOL DisconnectSilenceConnections(DWORD dwPeriod, BOOL bForce = TRUE) = 0;

public:

Expand Down Expand Up @@ -665,12 +676,14 @@ class IComplexSocket
virtual BOOL GetAllConnectionIDs (CONNID pIDs[], DWORD& dwCount) = 0;
/* ��ȡij������ʱ�������룩 */
virtual BOOL GetConnectPeriod (CONNID dwConnID, DWORD& dwPeriod) = 0;
/* ��ȡij�����Ӿ�Ĭʱ�䣨���룩 */
virtual BOOL GetSilencePeriod (CONNID dwConnID, DWORD& dwPeriod) = 0;
/* ��ȡij�����ӵ�Զ�̵�ַ��Ϣ */
virtual BOOL GetRemoteAddress (CONNID dwConnID, TCHAR lpszAddress[], int& iAddressLen, USHORT& usPort) = 0;
/* ��ȡ���һ��ʧ�ܲ����Ĵ������ */
virtual EnSocketError GetLastError () = 0;
/* ��ȡ���һ��ʧ�ܲ����Ĵ������� */
virtual LPCTSTR GetLastErrorDesc() = 0;
virtual LPCTSTR GetLastErrorDesc () = 0;
/* ��ȡ������δ�������ݵij��� */
virtual BOOL GetPendingDataLength (CONNID dwConnID, int& iPending) = 0;

Expand All @@ -692,6 +705,8 @@ class IComplexSocket
virtual void SetWorkerThreadCount (DWORD dwWorkerThreadCount) = 0;
/* ���ùر����ǰ�ȴ����ӹرյ��ʱ�ޣ����룬0 �򲻵ȴ��� */
virtual void SetMaxShutdownWaitTime (DWORD dwMaxShutdownWaitTime) = 0;
/* �����Ƿ��Ǿ�Ĭʱ�䣨����Ϊ TRUE ʱ DisconnectSilenceConnections() �� GetSilencePeriod() ����Ч��Ĭ�ϣ�FALSE�� */
virtual void SetMarkSilence (BOOL bMarkSilence) = 0;

/* ��ȡ���ݷ��Ͳ��� */
virtual EnSendPolicy GetSendPolicy () = 0;
Expand All @@ -711,6 +726,8 @@ class IComplexSocket
virtual DWORD GetWorkerThreadCount () = 0;
/* ��ȡ�ر��齨ǰ�ȴ����ӹرյ��ʱ�� */
virtual DWORD GetMaxShutdownWaitTime () = 0;
/* ����Ƿ��Ǿ�Ĭʱ�� */
virtual BOOL IsMarkSilence () = 0;

public:
virtual ~IComplexSocket() {}
Expand Down
Binary file modified HP-Socket/Bin/HPSocket/x64/HPSocket.dll
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket/x64/HPSocket.lib
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket/x64/HPSocket_D.dll
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket/x64/HPSocket_D.lib
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket/x64/HPSocket_U.dll
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket/x64/HPSocket_U.lib
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket/x64/HPSocket_UD.dll
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket/x64/HPSocket_UD.lib
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket/x86/HPSocket.dll
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket/x86/HPSocket.lib
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket/x86/HPSocket_D.dll
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket/x86/HPSocket_D.lib
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket/x86/HPSocket_U.dll
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket/x86/HPSocket_U.lib
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket/x86/HPSocket_UD.dll
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket/x86/HPSocket_UD.lib
Binary file not shown.
34 changes: 34 additions & 0 deletions HP-Socket/Bin/HPSocket4C/HPSocket4C.h
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,17 @@ HPSOCKET_API BOOL __stdcall HP_Server_Disconnect(HP_Server pServer, HP_CONNID dw
*/
HPSOCKET_API BOOL __stdcall HP_Server_DisconnectLongConnections(HP_Server pServer, DWORD dwPeriod, BOOL bForce);

/*
* ���ƣ��Ͽ���Ĭ����
* �������Ͽ�����ָ��ʱ���ľ�Ĭ����
*
* ������ dwPeriod -- ʱ�������룩
* bForce -- �Ƿ�ǿ�ƶϿ�����
* ����ֵ�� TRUE -- �ɹ�
* FALSE -- ʧ��
*/
HPSOCKET_API BOOL __stdcall HP_Server_DisconnectSilenceConnections(HP_Server pServer, DWORD dwPeriod, BOOL bForce);

/******************************************************************************/
/***************************** Server ���Է��ʷ��� *****************************/

Expand Down Expand Up @@ -504,6 +515,8 @@ HPSOCKET_API DWORD __stdcall HP_Server_GetConnectionCount(HP_Server pServer);
HPSOCKET_API BOOL __stdcall HP_Server_GetAllConnectionIDs(HP_Server pServer, HP_CONNID pIDs[], DWORD* pdwCount);
/* ��ȡij���ͻ�������ʱ�������룩 */
HPSOCKET_API BOOL __stdcall HP_Server_GetConnectPeriod(HP_Server pServer, HP_CONNID dwConnID, DWORD* pdwPeriod);
/* ��ȡij�����Ӿ�Ĭʱ�䣨���룩 */
HPSOCKET_API BOOL __stdcall HP_Server_GetSilencePeriod(HP_Server pServer, HP_CONNID dwConnID, DWORD* pdwPeriod);
/* ��ȡ���� Socket �ĵ�ַ��Ϣ */
HPSOCKET_API BOOL __stdcall HP_Server_GetListenAddress(HP_Server pServer, TCHAR lpszAddress[], int* piAddressLen, USHORT* pusPort);
/* ��ȡij�����ӵ�Զ�̵�ַ��Ϣ */
Expand All @@ -527,6 +540,8 @@ HPSOCKET_API void __stdcall HP_Server_SetFreeBufferObjHold(HP_Server pServer, DW
HPSOCKET_API void __stdcall HP_Server_SetWorkerThreadCount(HP_Server pServer, DWORD dwWorkerThreadCount);
/* ���ùرշ���ǰ�ȴ����ӹرյ��ʱ�ޣ����룬0 �򲻵ȴ��� */
HPSOCKET_API void __stdcall HP_Server_SetMaxShutdownWaitTime(HP_Server pServer, DWORD dwMaxShutdownWaitTime);
/* �����Ƿ��Ǿ�Ĭʱ�䣨����Ϊ TRUE ʱ DisconnectSilenceConnections() �� GetSilencePeriod() ����Ч��Ĭ�ϣ�FALSE�� */
HPSOCKET_API void __stdcall HP_Server_SetMarkSilence(HP_Server pServer, BOOL bMarkSilence);

/* ��ȡ���ݷ��Ͳ��� */
HPSOCKET_API En_HP_SendPolicy __stdcall HP_Server_GetSendPolicy(HP_Server pServer);
Expand All @@ -546,6 +561,8 @@ HPSOCKET_API DWORD __stdcall HP_Server_GetFreeBufferObjHold(HP_Server pServer);
HPSOCKET_API DWORD __stdcall HP_Server_GetWorkerThreadCount(HP_Server pServer);
/* ��ȡ�رշ���ǰ�ȴ����ӹرյ��ʱ�� */
HPSOCKET_API DWORD __stdcall HP_Server_GetMaxShutdownWaitTime(HP_Server pServer);
/* ����Ƿ��Ǿ�Ĭʱ�� */
HPSOCKET_API BOOL __stdcall HP_Server_IsMarkSilence(HP_Server pServer);

/**********************************************************************************/
/******************************* TCP Server �������� *******************************/
Expand Down Expand Up @@ -707,6 +724,17 @@ HPSOCKET_API BOOL __stdcall HP_Agent_Disconnect(HP_Agent pAgent, HP_CONNID dwCon
*/
HPSOCKET_API BOOL __stdcall HP_Agent_DisconnectLongConnections(HP_Agent pAgent, DWORD dwPeriod, BOOL bForce);

/*
* ���ƣ��Ͽ���Ĭ����
* �������Ͽ�����ָ��ʱ���ľ�Ĭ����
*
* ������ dwPeriod -- ʱ�������룩
* bForce -- �Ƿ�ǿ�ƶϿ�����
* ����ֵ�� TRUE -- �ɹ�
* FALSE -- ʧ��
*/
HPSOCKET_API BOOL __stdcall HP_Agent_DisconnectSilenceConnections(HP_Agent pAgent, DWORD dwPeriod, BOOL bForce);

/******************************************************************************/
/***************************** Agent ���Է��ʷ��� *****************************/

Expand Down Expand Up @@ -742,6 +770,8 @@ HPSOCKET_API DWORD __stdcall HP_Agent_GetConnectionCount(HP_Agent pAgent);
HPSOCKET_API BOOL __stdcall HP_Agent_GetAllConnectionIDs(HP_Agent pAgent, HP_CONNID pIDs[], DWORD* pdwCount);
/* ��ȡij������ʱ�������룩 */
HPSOCKET_API BOOL __stdcall HP_Agent_GetConnectPeriod(HP_Agent pAgent, HP_CONNID dwConnID, DWORD* pdwPeriod);
/* ��ȡij�����Ӿ�Ĭʱ�䣨���룩 */
HPSOCKET_API BOOL __stdcall HP_Agent_GetSilencePeriod(HP_Agent pAgent, HP_CONNID dwConnID, DWORD* pdwPeriod);
/* ��ȡij�����ӵı��ص�ַ��Ϣ */
HPSOCKET_API BOOL __stdcall HP_Agent_GetLocalAddress(HP_Agent pAgent, HP_CONNID dwConnID, TCHAR lpszAddress[], int* piAddressLen, USHORT* pusPort);
/* ��ȡij�����ӵ�Զ�̵�ַ��Ϣ */
Expand Down Expand Up @@ -771,6 +801,8 @@ HPSOCKET_API void __stdcall HP_Agent_SetFreeBufferObjHold(HP_Agent pAgent, DWORD
HPSOCKET_API void __stdcall HP_Agent_SetWorkerThreadCount(HP_Agent pAgent, DWORD dwWorkerThreadCount);
/* ���ùر����ǰ�ȴ����ӹرյ��ʱ�ޣ����룬0 �򲻵ȴ��� */
HPSOCKET_API void __stdcall HP_Agent_SetMaxShutdownWaitTime(HP_Agent pAgent, DWORD dwMaxShutdownWaitTime);
/* �����Ƿ��Ǿ�Ĭʱ�䣨����Ϊ TRUE ʱ DisconnectSilenceConnections() �� GetSilencePeriod() ����Ч��Ĭ�ϣ�FALSE�� */
HPSOCKET_API void __stdcall HP_Agent_SetMarkSilence(HP_Agent pAgent, BOOL bMarkSilence);

/* ��ȡ���ݷ��Ͳ��� */
HPSOCKET_API En_HP_SendPolicy __stdcall HP_Agent_GetSendPolicy(HP_Agent pAgent);
Expand All @@ -790,6 +822,8 @@ HPSOCKET_API DWORD __stdcall HP_Agent_GetFreeBufferObjHold(HP_Agent pAgent);
HPSOCKET_API DWORD __stdcall HP_Agent_GetWorkerThreadCount(HP_Agent pAgent);
/* ��ȡ�ر����ǰ�ȴ����ӹرյ��ʱ�� */
HPSOCKET_API DWORD __stdcall HP_Agent_GetMaxShutdownWaitTime(HP_Agent pAgent);
/* ����Ƿ��Ǿ�Ĭʱ�� */
HPSOCKET_API BOOL __stdcall HP_Agent_IsMarkSilence(HP_Agent pAgent);

/**********************************************************************************/
/******************************* TCP Agent �������� *******************************/
Expand Down
Binary file modified HP-Socket/Bin/HPSocket4C/x64/HPSocket4C.dll
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket4C/x64/HPSocket4C.lib
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket4C/x64/HPSocket4C_D.dll
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket4C/x64/HPSocket4C_D.lib
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket4C/x64/HPSocket4C_U.dll
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket4C/x64/HPSocket4C_U.lib
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket4C/x64/HPSocket4C_UD.dll
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket4C/x64/HPSocket4C_UD.lib
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket4C/x86/HPSocket4C.dll
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket4C/x86/HPSocket4C.lib
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket4C/x86/HPSocket4C_D.dll
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket4C/x86/HPSocket4C_D.lib
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket4C/x86/HPSocket4C_U.dll
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket4C/x86/HPSocket4C_U.lib
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket4C/x86/HPSocket4C_UD.dll
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket4C/x86/HPSocket4C_UD.lib
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket4CS/x64/HPSocket4C_U.dll
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket4CS/x64/HPSocketCS.dll
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket4CS/x86/HPSocket4C_U.dll
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket4CS/x86/HPSocketCS.dll
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket4E/Lib/HPSocket_4C.lib
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket4E/Lib/Hp_Socket.fne
Binary file not shown.
Binary file modified HP-Socket/Bin/HPSocket4E/Lib/Hp_Socket_static.lib
Binary file not shown.
Binary file modified HP-Socket/DLL/HPSocketDLL/HPSocketDLL.suo
Binary file not shown.
Binary file modified HP-Socket/DLL/HPSocketDLL4C/HPSocketDLL4C.suo
Binary file not shown.
Binary file modified HP-Socket/Demo/HttpProxy/HttpProxy.suo
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,16 @@ public class HPSocketSdk
[DllImport(SOCKET_DLL_PATH)]
public static extern bool HP_Server_DisconnectLongConnections(IntPtr pServer, uint dwPeriod, bool bForce);

/// <summary>
/// 断开超过指定时长的静默连接
/// </summary>
/// <param name="pServer"></param>
/// <param name="dwPeriod">时长(毫秒)</param>
/// <param name="bForce">是否强制断开连接</param>
/// <returns></returns>
[DllImport(SOCKET_DLL_PATH)]
public static extern bool HP_Server_DisconnectSilenceConnections(IntPtr pServer, uint dwPeriod, bool bForce);

/******************************************************************************/
/***************************** Server 属性访问方法 *****************************/

Expand Down Expand Up @@ -715,6 +725,16 @@ public class HPSocketSdk
[DllImport(SOCKET_DLL_PATH)]
public static extern bool HP_Server_GetConnectPeriod(IntPtr pServer, IntPtr dwConnId, ref uint pdwPeriod);

/// <summary>
/// 获取某个连接静默时间(毫秒)
/// </summary>
/// <param name="pServer"></param>
/// <param name="dwConnId"></param>
/// <param name="pdwPeriod"></param>
/// <returns></returns>
[DllImport(SOCKET_DLL_PATH)]
public static extern bool HP_Server_GetSilencePeriod(IntPtr pServer, IntPtr dwConnId, ref uint pdwPeriod);

/// <summary>
/// 获取监听 Socket 的地址信息
/// </summary>
Expand Down Expand Up @@ -795,6 +815,13 @@ public class HPSocketSdk
[DllImport(SOCKET_DLL_PATH)]
public static extern void HP_Server_SetMaxShutdownWaitTime(IntPtr pServer, uint dwMaxShutdownWaitTime);

/// <summary>
/// 设置是否标记静默时间(设置为 TRUE 时 DisconnectSilenceConnections() 和 GetSilencePeriod() 才有效,默认:FALSE)
/// </summary>
/// <param name="pServer"></param>
/// <param name="bMarkSilence"></param>
[DllImport(SOCKET_DLL_PATH)]
public static extern void HP_Server_SetMarkSilence(IntPtr pServer, bool bMarkSilence);

/// <summary>
/// 获取 Socket 缓存对象锁定时间
Expand Down Expand Up @@ -852,6 +879,14 @@ public class HPSocketSdk
[DllImport(SOCKET_DLL_PATH)]
public static extern uint HP_Server_GetMaxShutdownWaitTime(IntPtr pServer);

/// <summary>
/// 检测是否标记静默时间
/// </summary>
/// <param name="pServer"></param>
/// <returns></returns>
[DllImport(SOCKET_DLL_PATH)]
public static extern bool HP_Server_IsMarkSilence(IntPtr pServer);

/**********************************************************************************/
/***************************** TCP Server 操作方法 *****************************/

Expand Down Expand Up @@ -1447,6 +1482,16 @@ public class HPSocketSdk
[DllImport(SOCKET_DLL_PATH)]
public static extern bool HP_Agent_DisconnectLongConnections(IntPtr pAgent, uint dwPeriod, bool bForce);

/// <summary>
/// 断开超过指定时长的静默连接
/// </summary>
/// <param name="pServer"></param>
/// <param name="dwPeriod">时长(毫秒)</param>
/// <param name="bForce">是否强制断开连接</param>
/// <returns></returns>
[DllImport(SOCKET_DLL_PATH)]
public static extern bool HP_Agent_DisconnectSilenceConnections(IntPtr pAgent, uint dwPeriod, bool bForce);

/******************************************************************************/
/***************************** Agent 操作方法 *****************************/

Expand Down Expand Up @@ -1565,6 +1610,16 @@ public class HPSocketSdk
[DllImport(SOCKET_DLL_PATH)]
public static extern bool HP_Agent_GetConnectPeriod(IntPtr pAgent, IntPtr dwConnId, ref uint pdwPeriod);

/// <summary>
/// 获取某个连接静默时间(毫秒)
/// </summary>
/// <param name="pServer"></param>
/// <param name="dwConnId"></param>
/// <param name="pdwPeriod"></param>
/// <returns></returns>
[DllImport(SOCKET_DLL_PATH)]
public static extern bool HP_Agent_GetSilencePeriod(IntPtr pAgent, IntPtr dwConnId, ref uint pdwPeriod);

/// <summary>
/// 获取监听 Socket 的地址信息
/// </summary>
Expand Down Expand Up @@ -1670,6 +1725,14 @@ public class HPSocketSdk
[DllImport(SOCKET_DLL_PATH)]
public static extern void HP_Agent_SetMaxShutdownWaitTime(IntPtr pAgent, uint dwMaxShutdownWaitTime);

/// <summary>
/// 设置是否标记静默时间(设置为 TRUE 时 DisconnectSilenceConnections() 和 GetSilencePeriod() 才有效,默认:FALSE)
/// </summary>
/// <param name="pServer"></param>
/// <param name="bMarkSilence"></param>
[DllImport(SOCKET_DLL_PATH)]
public static extern void HP_Agent_SetMarkSilence(IntPtr pAgent, bool bMarkSilence);

/// <summary>
/// 获取 Socket 缓存对象锁定时间
/// </summary>
Expand Down Expand Up @@ -1726,6 +1789,14 @@ public class HPSocketSdk
[DllImport(SOCKET_DLL_PATH)]
public static extern uint HP_Agent_GetMaxShutdownWaitTime(IntPtr pAgent);

/// <summary>
/// 检测是否标记静默时间
/// </summary>
/// <param name="pServer"></param>
/// <returns></returns>
[DllImport(SOCKET_DLL_PATH)]
public static extern bool HP_Agent_IsMarkSilence(IntPtr pAgent);

/**********************************************************************************/
/***************************** TCP Agent 属性访问方法 *****************************/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,28 @@ public bool Disconnect(IntPtr connId, bool force = true)
return HPSocketSdk.HP_Agent_Disconnect(pAgent, connId, force);
}

/// <summary>
/// 断开超过指定时间的连接
/// </summary>
/// <param name="period">毫秒</param>
/// <param name="force">强制</param>
/// <returns></returns>
public bool DisconnectLongConnections(uint period, bool force = true)
{
return HPSocketSdk.HP_Agent_DisconnectLongConnections(pAgent, period, force);
}

/// <summary>
/// 断开超过指定时长的静默连接
/// </summary>
/// <param name="period">毫秒</param>
/// <param name="force">强制</param>
/// <returns></returns>
public bool DisconnectSilenceConnections(uint period, bool force = true)
{
return HPSocketSdk.HP_Agent_DisconnectSilenceConnections(pAgent, period, force);
}

/// <summary>
/// 设置连接的附加数据
/// </summary>
Expand Down Expand Up @@ -549,6 +571,28 @@ public bool GetRemoteAddress(IntPtr connId, ref string ip, ref ushort port)
return ret;
}

/// <summary>
/// 获取指定连接的连接时长(毫秒)
/// </summary>
/// <param name="connId"></param>
/// <param name="period"></param>
/// <returns></returns>
public bool GetConnectPeriod(IntPtr connId, ref uint period)
{
return HPSocketSdk.HP_Agent_GetConnectPeriod(pAgent, connId, ref period);
}

/// <summary>
/// 获取某个连接静默时间(毫秒)
/// </summary>
/// <param name="connId"></param>
/// <param name="period"></param>
/// <returns></returns>
public bool GetSilencePeriod(IntPtr connId, ref uint period)
{
return HPSocketSdk.HP_Agent_GetSilencePeriod(pAgent, connId, ref period);
}

///////////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// 置是否启用地址重用机制(默认:不启用)
Expand Down Expand Up @@ -658,6 +702,15 @@ public void SetMaxShutdownWaitTime(uint val)
HPSocketSdk.HP_Agent_SetMaxShutdownWaitTime(pAgent, val);
}

/// <summary>
/// 设置是否标记静默时间(设置为 TRUE 时 DisconnectSilenceConnections() 和 GetSilencePeriod() 才有效,默认:FALSE)
/// </summary>
/// <param name="val"></param>
public void SetMarkSilence(bool val)
{
HPSocketSdk.HP_Agent_SetMarkSilence(pAgent, val);
}

/// <summary>
/// 获取工作线程数量
/// </summary>
Expand Down Expand Up @@ -748,6 +801,15 @@ public uint GetMaxShutdownWaitTime()
return HPSocketSdk.HP_Agent_GetMaxShutdownWaitTime(pAgent);
}

/// <summary>
/// 检测是否标记静默时间
/// </summary>
/// <returns></returns>
public bool IsMarkSilence()
{
return HPSocketSdk.HP_Agent_IsMarkSilence(pAgent);
}

/// <summary>
/// 根据错误码返回错误信息
/// </summary>
Expand Down
Loading