HP-Socket for Linux 1.0.0 Released

==========================================================================================
HP-Socket for Linux 1.0.0 update:
==========================================================================================

> Create HP-Socket Basic Components:
—————–

  1. Server: TCP Server, TCP Pull Server, TCP Pack Server, UDP Server.
  2. Agent: TCP Agent, TCP Pull Agent, TCP Pack Agent.
  3. Client: TCP Client, TCP Pull Client, TCP Pack Client, UDP Client, UDP Cast.

> Create Demos:
—————–

  1. testecho: tcp simple test echo server/agent/client.
  2. testecho-pfm: tcp performance test echo server/agent/client.
  3. testecho-pull: tcp pull echo server/agent/client.
  4. testecho-pack: tcp pack echo server/agent/client.
  5. testecho-udp: udp simple echo server/client/cast.
  6. testecho-udp-pfm: udp performance test echo server/client.
  7. testecho-lib: tcp pull echo server/agent/client (use hpsocket.so and hpsocket4c.so).

==========================================================================================
v5.1.1 update:
==========================================================================================

> Add ‘pause receiving’ function:
—————–

  1. All components support ‘pause receiving’ function, except for UDP Server.
  2. API update list:
    • HP_Server_PauseReceive (ADD)
    • HP_Server_IsPauseReceive (ADD)
    • HP_Agent_PauseReceive (ADD)
    • HP_Agent_IsPauseReceive (ADD)
    • HP_Client_PauseReceive(ADD)
    • HP_Client_IsPauseReceive(ADD)

> Other Updates:
—————–

  1. TCP Agent component add method HP_Agent_ConnectWithExtra(), support binding extra data before connection has completed.
  2. Common code package vc-common-src update to v2.3.22.
  3. OpenSSL update to v1.1.0g.

==========================================================================================
v5.0.2 update:
==========================================================================================

> Bug Fix:
—————–

  1. Fix Bug: PULL/PACK components may be occasionally crash.
  2. Affected components: Pull Server, Pull Agent, Pack Server, Pack Agen.

==========================================================================================
v5.0.1 update:
==========================================================================================

> IPv6 supported:
—————–

  1. All components support IPv6.
  2. Component interfaces does not change, and components automatically identifies IPv4 / IPv6 through the incoming address parameter.
  3. API update list:
    • enum En_HP_IPAddrType (ADD)
    • struct HP_TIPAddr (ADD)
    • SYS_GetIPv4InAddr (DEL)
    • SYS_GetOptimalIPByHostName (DEL)
    • SYS_IsIPAddress (MOD)
    • SYS_GetIPAddress (MOD)
    • SYS_EnumHostIPAddresses (ADD)
    • SYS_FreeHostIPAddresses (ADD)

> SSL Update:
—————–

  1. Multiple SSL certificates supported: each component object can use it’s different SSL certificate.
  2. Component object binds the independent SSL Context, replacing the old version of the globally unique SSL Context.
  3. API update list:
    • HP_SSL_Initialize (DEL)
    • HP_SSL_Cleanup (DEL)
    • HP_SSL_AddServerContext (DEL)
    • HP_SSL_IsValid (DEL)
    • HP_SSLAgent_SetupSSLContext (ADD)
    • HP_SSLClient_SetupSSLContext (ADD)
    • HP_SSLServer_SetupSSLContext (ADD)
    • HP_SSLServer_AddSSLContext (ADD)
    • HP_SSLAgent_CleanupSSLContext (ADD)
    • HP_SSLClient_CleanupSSLContext (ADD)
    • HP_SSLServer_CleanupSSLContext (ADD)

> Other Updates:
—————–

  1. Demo update: all Demos support IPv6; all SSL Demos support the new certificate mechanism.
  2. Common code package vc-common-src update to v2.3.20.

==========================================================================================
v4.3.1 update:
==========================================================================================

> HTTP:
—————–

  1. IHttpClient and IHttpAgent components are compatible with HTTP response messages with no length identification (such as: Content-Length, Header).
  2. IHttpClient and IHttpAgent components improve the response processing of HEAD request, and the application does not need to return a special value ‘HPR_SKIP_BODY’ in ‘OnHeadersComplete’ event.

> Other Updates:
—————–

  1. Optimizing IServer/IAgent components to improve performance and stability.
  2. Common code package vc-common-src update to v2.3.19.
  3. OpenSSL update to version 1.1.0f.

==========================================================================================
v4.2.1 update:
==========================================================================================

> HTTP Cookie management:
—————–

  1. Add Cookie manager, cookies can be shared between different components and different connections.
  2. Cookie manager implements the standard HTTP Cookie manage functions, support Max-Age, expires, httpOnly, secure, etc.
  3. Cookie manager supports Cookie serialization and de serialization.
  4. IHttpClient and IHttpAgent components can use SetUseCookie() method to turn on/off Cookie functions.

> HTTP Sync Client component update:
—————–

  1. Create_HP_HttpSyncClient() and Create_HP_HttpsSyncClient() methods add optional parameter ‘pListener’.
  2. If the ‘pListener’ argument is not null, you can monitor all communication events of HttpSyncClient by ‘pListener’.

> other updates:
—————–

  1. Demp update: HttpProxy, TestEcho-Http, TestEcho-Http-4C.
  2. Common code package vc-common-src update to v2.3.18.
  3. OpenSSL update to version 1.1.0e.

==========================================================================================
v4.1.3 update:
==========================================================================================

> Code optimization:
—————–

  1. Modify the trigger rule of Onclose event with SP_DIRECT send mode in ITcpServer and ITcpAgent components.
  2. Improve stability of IClient components.

> update instructions:
—————–

  1. HP-Socket v4.1.3 fully compatible with the HP-Socket v4.1.2 version, you can directly replace the upgrade.

==========================================================================================
v4.1.2 update:
==========================================================================================

> Code optimization:
—————–

  1. Improving security of asynchronous operation using new ring buffer algorithm.
  2. Using delay release strategy to improve HTTP asynchronous operation security.

> update instructions:
—————–

  1. HP-Socket v4.1.2 fully compatible with the HP-Socket v4.1.1 version, you can directly replace the upgrade.

==========================================================================================
v4.1.1 update:
==========================================================================================

> WebSocket supported:
—————–

  1. Add following WebSocket Methods for all HTTP Components:
    • SendWSMessage()
    • GetWSMessageState()
  2. Add following Events for all HTTP Listeners:
    • OnWSMessageHeader()
    • OnWSMessageBody()
    • OnWSMessageComplete()
  3. HTTP Demos (TestEcho-Http & TestEcho-Http-4C ) support WebSocket

> Add Http Sync Client Component
—————–

  1. HTTP Sync Client implements synchronous HTTP communication, does not require any Listener.
  2. HTTP Sync Client component classes: CHttpSyncClient, CHttpsSyncClient.
  3. HTTP Sync Client implemented interfaces: ITcpClient / IHttpSyncRequester.
  4. HTTP Demos (TestEcho-Http & TestEcho-Http-4C ) provide HTTP Sync Client demonstrate.

> update instructions:
—————–

  1. HP-Socket v4.1.1 fully compatible with the HP-Socket v4.0.1 version, you can directly replace the upgrade.

==========================================================================================
v4.0.1 update:
==========================================================================================

> Add HTTP Components:
—————–

  1. Add HTTP Server Components:
    • Component Classes: CHttpServer, CHttpsServer
    • Implemented Interfaces: ITcpServer / IComplexHttpResponder
    • Listener Interface: IHttpServerListener
  2. Add HTTP Agent Components:
    • Component Classes: CHttpAgent, CHttpsAgent
    • Implemented Interfaces: ITcpAgent / IComplexHttpRequester
    • Listener Interface: IHttpAgentListener
  3. Add HTTP Client Components:
    • Component Classes: CHttpClient, CHttpsClient
    • Implemented Interfaces: ITcpClient / IHttpRequester
    • Listener Interface: IHttpClientListener
  4. Add HTTP Application Demos:
    • TestEcho-Http           (source code)
    • TestEcho-Http-4C    (4C Lib / 4C DLL)
  5. HTTP Listener:
    • Listener Events
      OnMessageBegin() : [Optional] begin parse http message
      OnRequestLine() : [Optional] finish parse request line (server only)
      OnStatusLine() : [Optional] finish parse status line (client only)
      OnHeader() : [Optional] parse a http header
      OnHeadersComplete() : [Required] finish parse all http headers
      OnBody() : [Required] receive a body frame
      OnChunkHeader() : [Optional] parse a chunked header
      OnChunkComplete() : [Optional] finish all chunked
      OnMessageComplete() : [Required] finish parse a complete http message
      OnUpgrade() : [Optional] http protocol upgrade notice
      OnParseError() : [Required] parse error notice
    • Listener Event Return Value (EnHttpParseResult)
      HPR_OK : parse OK
      HPR_SKIP_BODY : skip parsing current http body (only used by OnHeadersComplete event)
      HPR_UPGRADE : upgrade http protocol (only used by OnHeadersComplete event)
      HPR_ERROR : parse error, abort parsing, disconnect

> Component interface update
—————–

  1. All listener callback methods of IServer and IAgent components add “event source” parameters, such as: OnShutdown() -> OnShutdown(T* pSender).
  2. All listener callback methods of IClient components add “connection ID” parameters, such as: OnHandShake(IClient* pClient) -> OnHandShake(T* pSender, CONNID dwConnID).
  3. IServer and IAgent interface add method: Get/SetMaxConnectionCount(), used to set the maximum number of connections, the maximum number of connections by default: 10000.
  4. OnHandShake() event trigger rule adjustment: non-SSL components also trigger OnHandShake() event, so that the SSL and non-SSL component processing process is consistent.
  5. HPSocket4C add construcion & destruction methods for PACK component listeners, HPSocket4C must use the following methods to create and destroy the PACK component listeners:
    Create_HP_TcpPackServerListener / Destroy_HP_TcpPackServerListener
    Create_HP_TcpPackAgentListener / Destroy_HP_TcpPackAgentListener
    Create_HP_TcpPackClientListener / Destroy_HP_TcpPackClientListener
  6. SSL components support SNI:
    • SSL initialization method: HP_SSL_Initialize () add SNI callback function pointer parameter
    • Add method HP_SSL_AddServerContext (), used to load the SNI host certificate

> other updates:
—————–

  1. IServer and IAgent components using “Ring Pool” replace “R/W Lock + Map” to maintenance active to connections, enhance the R/W concurrent performance.
  2. Update all Demo sample code.

> update instructions:
—————–

  1. HP-Socket v4.0.1 is not compatible with HP-Socket v3.5.4.
  2. All listener callback method parameters of IServer, IAgent and IClient are changed.
  3. Note: HPSocket4C uses new method to creating and destroying PACK components listeners.
  4. Note: which applications thad uses IServer and IAgent need to set the maximum number of connections in accordance with the actual usage scenarios.

==========================================================================================
v3.5.4 update:
==========================================================================================

> Bug Fix:
—————–

  1. IClient components bug fix: IClient component is disconnecting when the connection is sending data and can cause the program to crash.
  2. Optimized CCASQueue class in vc-common-src public code package.

> update instructions:
—————–

  1. HP-Socket v3.5.4 fully compatible with the HP-Socket v3.5.3 version, you can directly replace the upgrade.

==========================================================================================
v3.5.3 update:
==========================================================================================

> Bug Fix:
—————–

  1. IClient components bug fix: IClient component perhaps trigger OnClose() event twice, in the extreme cases.
  2. IClient components bug fix: the destruction of IClient objects cause the program to crash, in the extreme case.

> update instructions:
—————–

  1. HP-Socket v3.5.3 fully compatible with the HP-Socket v3.5.2 version, you can directly replace the upgrade.

==========================================================================================
v3.5.2 update:
==========================================================================================

> Component interface update:
—————–

  1. IClient component Start() method change the default connection to asynchronous connections.
  2. IClient component Start() method add optional parameter lpszBindAddress, set the binding address.
  3. HPSocket-4C add method HP_Client_StartWithBindAddress() to start with binding address.
  4. IUdpCast component delete Get/SetBindAddress() method.
  5. IServer component add GetLocalAddress () method for retrive the local address.
  6. Add 2 global functions SYS_GetSocketLocalAddress () and SYS_GetSocketRemoteAddress () for obtain the SOCKET local and remote address.

> update instructions:
—————–

  1. HP-Socket v3.5.2 fully compatible with the HP-Socket v3.5.1 version, you can directly replace the upgrade.

==========================================================================================
v3.5.1 update:
==========================================================================================

> Add SSL components:
—————–

  1. Add SSL PUSH components: CSSLServer, CSSLAgent, CSSLClient.
  2. Add SSL PULL components: CSSLPullServer, CSSLPullAgent, CSSLPullClient.
  3. Add SSL PACK components: CSSLPackServer, CSSLPackAgent, CSSLPackClient.
  4. SSL Server implements ITcpServer interface, SSL Agent implements ITcpAgent interface, SSL Client implements ITcpClient interface.
  5. Before start SSL components, need to call the HP_SSL_Initialize() function to initialize the SSL global environment parameters.
  6. After stop SSL components, optional call HP_SSL_Cleanup () function to clean up the SSL global operation environment.
  7. Add SSL related sample Demo:
    • TestEcho-SSL  (source code)
    • TestEcho-SSL-Pack  (DLL / 4C DLL)
    • TestEcho-SSL-4C  (4C LIB)
    • TestEcho-SSL-PFM  (LIB)

> Component interfaces update
—————–

  1. ITcpServerListener interface add SSL handshake event: OnHandShake (CONNID dwConnID).
  2. ITcpAgentListener interface add SSL handshake event: OnHandShake (CONNID dwConnID).
  3. ITcpClientListener interface add SSL handshake event: OnHandShake (IClient* pClient).
  4. Enumeration type EnSocketError add ‘SSL environment not ready’ error code SE_SSL_ENV_NOT_READY.
  5. Add enumeration type: EnSSLSessionMode (SSL working mode), EnSSLVerifyMode (SSL validation mode).
  6. HPSocket-SSL DLL main header file: SocketInterface-SSL.h, HPSocket-SSL.h.
  7. HPSocket4C-SSL DLL main header file: HPSocket4C-SSL.h.
  8. Tcp Pack series of components can be set to adjust the maximum length of 4194303/0x3FFFFF bytes.
  9. Tcp Pack series of components of the effective identification of the scope of Baotou to adjust to 0 ~ 1023/0x3FF.

> Add STATIC LIB projects
—————–

  1. Added static lib project HPSocketLIB and HPSocketLIB4C for compiling HPSocket and HPSocket4C static libraries.
  2. Static library and dynamic library of the use of the same way (refer to the example Demo: TestEcho-SSL-4C and TestEcho-SSL-PFM).
  3. Using HPSocket or HPSocket4C static library, need to define preprocessor macro – > HPSOCKET_STATIC_LIB in project properties.
  4. Static library destination file is not included in the release package (because it is too large), if you need to compile your own.

> update instructions:
—————–

  1. The non-SSL edition of HP-Socket v3.5.1 cannot be binary compatible with the v3.4.x, which needs to be re-compiled for application.
  2. TCP components add OnHandShake () events, the use of C++ interface applications need to deal with the incident, for non-SSL components can provide an empty implementation.

==========================================================================================
v3.4.4 update:
==========================================================================================

> Bug Fix:
—————–

  1. Fixed TCP of Pack Agent “asynchronous connection failure causes the program to crash” Bug.

> update instructions:
—————–

  1. HP-Socket v3.4.4 fully compatible with the HP-Socket v3.4.3 version, you can directly replace the upgrade.

==========================================================================================
v3.4.3 update:
==========================================================================================

> Bug Fix:
—————–

  1. Fixed of vc-common-src public code package CCASQueue can lead to infinite loop Bug.

> update instructions:
—————–

  1. v3.4.3 HP-Socket fully compatible with the v3.4.2 HP-Socket version, you can directly replace the upgrade.

==========================================================================================
v3.4.2 update:
==========================================================================================

> Bug Fix:
—————–

  1. Fixed TcpPackServer and TcpPackAgent some property settings did not come into effect Bug.

> update instructions:
—————–

  1. v3.4.2 HP-Socket fully compatible with the v3.4.1 HP-Socket version, you can directly replace the upgrade.

==========================================================================================
v3.4.1 update:
==========================================================================================

> Add TCP PACK components:
—————–

  1. TCP Pack series of components ensure that every OnReceive() event would provide a complete data package to the application.
  2. TCP Pack series of component is a combination of the PUSH/PULL mode, the application does not have to deal with sub packages (such as: PUSH) and data capture (such as: PULL).
  3. TCP Pack series of component provide Get/SetMaxPackSize () and Get/SetPackHeaderFlag () method, used to set the maximum packet length and the package flag.
  4. CTcpPackServer implementation of the ITcpServer interface, CTcpPackAgent to achieve ITcpAgent interface, CTcpPackClient ITcpClient interface to achieve.

> Component interfaces update:
—————–

  1. OnClose/OnError is merged into a communication event: OnClose (dwConnID CONNID, enOperation EnSocketOperation, iErrorCode int).
  2. Enumeration type EnSocketOperation adds an enumeration value: SO_CLOSE = 5, which identifies the socket close operation.
  3. IServer and IAgent interface delete the interface method: Get/SetRecvPolicy ().
  4. IServer and IAgent interface delete the interface method: Get/SetMaxShutdownWaitTime ().

> update instructions:
—————–

  1. v3.3.2 HP-Socket and previous versions to upgrade to v3.4.1 HP-Socket version, need to modify the OnClose/OnError event processing code.

==========================================================================================
v3.3.2 update:
==========================================================================================

> Code optimization:
—————–

  1. improve compile compatibility.
  2. fix C# & E language known bugs.

> update instructions:
—————–

  1. HP-Socket v3.3.2 is compatible with HP-Socket v3.3.1, can be replaced and upgrade directly.

==========================================================================================
v3.3.1 update:
==========================================================================================

> Components interface changed:
—————–

  1. IClientListener listener interface uses IClient* parameter to replace CONNID parameter to identify Client communication object
  2. add IPullClient interface,used as PULL Client component base interface.
  3. IPullSocket and IPullClient interface add Peek() method to use to snoop buffer data (does not remove the buffer data)
  4. add IComplexSocketListener listener interface,used as the Server/Agent component’s listener interface
  5. IComplexSocketListener offers OnShutdown notification method to replace Server/Agent communication component’s method OnServerShutdown/OnAgentShutdown
  6. IClient component adds Get/SetExtra() method to save customize additional data
  7. IServer & IAgent add 4 “Silence Process” methods:
    1) DisconnectSilenceConnections() : close all silence connections
    2) GetSilencePeriod() : get connection’s silence period
    3) SetMarkSilence() : set “mark silence” or not
    4) IsMarkSilence() : check “mark silence” or not

> add UdpCast communication component:
—————–

  1. UdpClient / UdpServer use in to the point to point unicast communication for C/S model,but in some application scenarios ,need to use the multicast or broadcast communication
  2. UdpCast achieve multicast or broadcast communication,UdpCast offers IUdpCast interface,extends the IClient,the following interface methods:
    /* 1) notification interface methods: */
    OnPrepareConnect(IClient* pClient, SOCKET socket)
    OnConnect(IClient* pClient)
    OnSend(IClient* pClient, const BYTE* pData, int iLength)
    OnReceive(IClient* pClient, const BYTE* pData, int iLength)
    OnClose(IClient* pClient)
    OnError(IClient* pClient, EnSocketOperation enOperation, int iErrorCode)
    /* 2) main operating methods : */
    Start(LPCTSTR pszBindAddress = nullptr, BOOL bAsyncConnect = TRUE /*This parameter is ignored*/)
    Stop()
    Connect(LPCTSTR pszRemoteAddress, USHORT usPort, CONNID* pdwConnID = nullptr)
    Send(CONNID dwConnID, const BYTE* pBuffer, int iLength, int iOffset = 0)
    SendPackets(const WSABUF pBuffers[], int iCount)
  3. add UdpCast using example:TestUDPCast

> update instructions:
—————–

  1. HP-Socket v3.3.1 is compatible with HP-Socket v3.2.3 in functions but not all compatible in code levels.You need to change when HP-Socket v3.2.3 updateto HP-Socket v3.3.1:
  2. You need to change when HP-Socket v3.2.3 updateto HP-Socket v3.3.1:

    1) Client component
    a) IClientListener listener interface adjusts,and all the parameters of the notification method adjusts
    b) PULL Client uses IPullClient as a base interface,Fetch()/Peek()method’s parameters adjust
    2) Agent/Server component
    a) OnShutdown replaces OnServerShutdown/OnAgentShutdown

==========================================================================================
v3.2.3 update:
==========================================================================================

> optimize Common-Src:
—————–

  1. optimize the synchronization mechanisms of HP-Socket
  2. raising overall performance of HP-Socket ten percent

> update instructions:
—————–

  1. HP-Socket v3.2.2 or previous versions for applications can updateto HP-Socket v3.2.3 safely

==========================================================================================
v3.2.2 update:
==========================================================================================

> Increase some methods for helps:
—————–

  1. Batch sending methods: SendPackets()
    1) IClient / IServer / IAgent add the sending methods: SendPackets(dwConnID, pBuffers[], iBufferCount)
    2) For TCP component – send all packets in order
    3) For UDP component – make all the packets combined into one packet and send (the length of the packet can not be greater than the maxinum of length of a UDP packet which is set up)
  2. small files sending methods: SendSmallFile()
    1) ITcpClient / ITcpServer / ITcpAgent add the small files sending methods: SendSmallFile(dwConnID, lpszFileName, pHead, pTail)
    2) By the parameters: pHead and pTail,each can add some definitions int the files heads and tails
    3) SendSmallFile() only send the files whose size small than  4096 KB
  3. HPSocket.dll and HPSocket4C.dll add following export methods:
      1) SYS_WSAGetLastError():call the system’s WSAGetLastError()
    2) SYS_SetSocketOption():call the system’s setsockopt()
    3) SYS_GetSocketOption():call the system’s getsockopt()
    4) SYS_IoctlSocket()           :call the system’s ioctlsocket()
    5) SYS_WSAIoctl()               :call the system’s WSAIoctl()

> update instructions:
—————–

  1. HP-Socket v3.2.1 or previous versions for applications can updateto HP-Socket v3.2.2 safely

==========================================================================================
v3.2.1 update:
==========================================================================================

> add communication components TcpAgent / TcpPullAgent :
—————–

  1. for the proxy server and transit server etc. , server can be the client and launche a large-scale service connections to other servers.
  2. TcpClient / TcpPullClient basic on  Event Select communication model,every component object manages one Socket and open a thread ,but the above scenario is not suitable.
  3. TcpAgent / TcpPullAgent basic on IOCP communication model,one componet object manages many Sockets,for the clients communication components of the proxy server and transit server.
  4. TcpAgent / TcpPullAgent methods are easy to use and provide following interface methods:
    1) notice interface methods:
    OnPrepareConnect(CONNID dwConnID, SOCKET socket)
    OnConnect(CONNID dwConnID)
    OnSend(CONNID dwConnID, const BYTE* pData, int iLength)
    OnReceive(CONNID dwConnID, const BYTE* pData, int iLength)    //(Push model)
    OnReceive(CONNID dwConnID, int iLength)                        //(Pull model)
    OnClose(CONNID dwConnID)
    OnError(CONNID dwConnID, EnSocketOperation enOperation, int iErrorCode)
    OnAgentShutdown()
         2) main operating methods:
    Start(LPCTSTR pszBindAddress = nullptr, BOOL bAsyncConnect = TRUE)
    Stop()
    Connect(LPCTSTR pszRemoteAddress, USHORT usPort, CONNID* pdwConnID = nullptr)
    Send(CONNID dwConnID, const BYTE* pBuffer, int iLength, int iOffset = 0)
    Disconnect(CONNID dwConnID, BOOL bForce = TRUE)
    Fetch(CONNID dwConnID, BYTE* pData, int iLength)    //(Pull model)
  5. add TcpAgent / TcpPullAgent excemples for user:
    1) Agent-PFM
    2) Agent-Pull
    3) Agent-4C
  6. add TcpAgent + TcpServer HTTP proxy server excemple:HttpProxy

> add HPSocket for Java SDK:
—————–

  1. provide Java development package:hpsocket-3.2.1.jar(by JNA ,now only supports Windows platform)
  2. running environment:JDK 1.6+,JVM runs server mode(”java -server”,in client mode,the properties affected)
  3. add the project TestEcho-4J,show the HPSocket4J using methods (includes Pull model examples and sample performance tests)
  4. MBCS and Unicode version are in the jars: org.jessma.hpsocket.mbcs and org.jessma.hpsocket.unicode
  5. HPSocket for Java SDK provides following communication components :
    1) TcpServer:TCP communication server component ,supports  PUSH/Pull model
    2) TcpClient:TCP communication client component ,supports  PUSH/Pull model
    3) TcpAgent :TCP communication  Agent component ,supports  PUSH/Pull model
    4) UdpServer:UDP communication server component ,supports  Push model
    5) UdpClient:UDP communication client component ,supports  Push model
  6. HPSocket4J using methods (using TcpAgent for example):
    /* 0: add the jars into the project: hpsocket-3.2.1.jar and jna-4.1.0.jar *//* 1: create communication component object  */
    TcpAgent agent = TcpAgent.create(Mode.PUSH);/* 2: set the callback function object  */
    // (optional )
    agent.setCallBackOnPrepareConnect(new OnPrepareConnectImpl());
    // (optional )
    agent.setCallBackOnConnect(new OnConnectImpl());
    // (required )Push model need to set OnReceive callback function object
    agent.setCallBackOnReceive(new OnReceiveImpl());
    // (required )Pull model need to set OnPullReceive callback function object
    // agent.setCallBackOnPullReceive(new OnPullReceiveImpl());
    // (optional )
    agent.setCallBackOnSend(new OnSendImpl());
    // (required )
    agent.setCallBackOnClose(new OnCloseImpl());
    // (required )
    agent.setCallBackOnError(new OnErrorImpl());
    // (optional )
    agent.setCallBackOnAgentShutdown(new OnAgentShutdownImpl());/* 3:start communication component  */
    agent.start(“127.0.0.1″, false);/* 4:connect server */
    agent.connect(“localhost”, (short)5555, pdwConnID);/* 5:handle communication data */
    // response OnReceive / OnPullReceive events and receive data
    // use    agent.send(dwConnID, data, data.length) to send data/* 6:close communication component  */
    agent.stop();/* 7:destroy communication component  */
    TcpAgent.destroy(agent);

> optimize data transmission / reception strategies:
—————–

  1. Server and Agent components provide the following three types of data transmission policy:
    1)PACK – packing mode(default)    :try to send data formmultiple operetions together to send and add transmission efficiency.
    2)SAFE – sage mode        :try to make data formmultiple operetions together to send,control the transmission rate ,and avoid buffer overflow
    3)DIRECT – direct mode        :each sending operation is delivered directly ,for when the loading is not high but it requires real-time high places.
  2. Server and Agent components provide the following two data-accept events:
    1)SERIAL – serial mode(default):trigger the same connection in the order: OnReceive and OnClose/OnError event
    2)PARALLEL – parallel mode    :in different communication threads , trigger the same connection OnReceive and OnClose/OnError event in the same time

> other updates :
—————–

  1. IServer’ GetClientAddress() method changes the name to : GetRemoteAddress()
  2. IClient’ Send() method deletes the parameter: “CONNID dwConnID”
  3. IClient/IServer/IAgent’ Send() method adds the pointer offset parameter “int iOffset” for sending data buffer
  4. add EnSendPolicy enumerated type,IServer/IAgent add sending mode setting method: SetSendPolicy()
  5. add EnRecvPolicy enumerated type,IServer/IAgent add receving mode setting method: SetRecvPolicy()
  6. IServer/IAgent add method:BOOL GetAllConnectionIDs(),get all connected CONNID
  7. IUdpServer add method:SetPostReceiveCount(),set Receive Number of predelivery
  8. EnServerError / EnClientError enumerated type unite into EnSocketError
  9. EnSocketError / EnHandleResult / EnFetchResult enumerated type moves out of the original class
  10. IClient/IServer/IAgent add method:BOOL GetPendingDataLength() to get the length of the data which is not issued
  11. HPSocket4C.dll add method SendPart(),supports assigning the pointer offset parameter for data buffer
  12. add HPSocket for C# SDK(by int 2e )
  13. add HPSocket easy language support lib(by Yecate )
  14. public code package vc-common-src upgrade tp v2.3.5(reference:vc-common-src v2.3.5′ Change Log)

> update instructions:
—————–

  1. HP-Socket v3.2.1 Comply HP-Socket v3.1.3 and previous versions in the functions
  2. interface changes,it’s needed to modify the programcode. Notice:the program can be replaced directly by v3.1.3′ DLL
  3. EnServerError / EnClientError enumerated type unite into EnSocketError,notice some of the enumerated tyoe changed

==========================================================================================
v3.1.3 update:
==========================================================================================

> add other language Demo:
—————–

  1. C#
  2. Delphi
  3. E language

> Bug Fixed:
—————–

  1. repair IP address misjudgment bug:
    1) when client component connnecting to the server,if the IP of the server has full bit(12个numbers:‘AAA.BBB.CCC.DDD’),then judged as the domain name
    2) affect component :all TCP/UDP client components
    3) affect version:v3.1.2 and all previous versions
  2. repair the domain name and host name’s IP parsing error bug:
    1) when client component connecting to the server by the domain name or host name,it may be resolved to the wrong IP address.
    2) affectcomponent :all TCP/UDP client components
    3) affect versions:v3.1.2 and all previous versions

> update instructions:
—————–
1、use HP-Socket v3.1.2 or previous versions for applications can upgrade to HP-Socket v3.1.3 safely

==========================================================================================
v3.1.2 update:
==========================================================================================

> alter the Server component’s OnClose() / OnError() event’s trigger rules:
—————–

  1. The TCP/UDP Server component of original versions,when you close a connection ,it might also fire the OnClose() event and several OnError() events
  2. for this possibility,the application need to make OnClose() / OnError() to process the event synchronously
  3. from v3.1.2 ,when there are OnClose() / OnError() events occuring together,component only notice the first event ,and ignore the left event.
  4. Therefore,when the application processes the OnClose() / OnError() event , it not need to deal with syschronization,and reduce the possibile bugs and writing or testing code burdens.

Example One:
————————————————————————————–
ISocketListener::EnHandleResult CServerDlg::OnClose(CONNID dwConnID)
{
// original versions:there are the concurrency of OnClose()/OnError(),put the code in the critical area and test the returned value

             CCriSecLock locallock(m_csPkgInfo);    // <– critical area

             PVOID pInfo = nullptr;

            if(m_Server->GetConnectionExtra(dwConnID, &pInfo) && pInfo != nullptr)    // <– testing the returned value
{
m_Server->SetConnectionExtra(dwConnID, nullptr);
delete pInfo;
}
}

Example two:
————————————————————————————–
ISocketListener::EnHandleResult CServerDlg::OnClose(CONNID dwConnID)
{
// v3.1.2 version:only receive one OnClose()/OnError() event ,can remove the code out of the critical area and testing the code.

            PVOID pInfo = nullptr;
m_Server->GetConnectionExtra(dwConnID, &pInfo);
ASSERT(pInfo != nullptr);

            delete pInfo;
}

> other updates :
—————–

  1. change TCP Server default parameters :
    1) DEFAULT_SOCKET_LISTEN_QUEUE    : 300
    2) DEFAULT_ACCEPT_SOCKET_COUNT    : 300
    3) DEFAULT_FREE_SOCKETOBJ_POOL    : 150
    4) DEFAULT_FREE_SOCKETOBJ_HOLD    : 450
    5) DEFAULT_FREE_BUFFEROBJ_POOL    : 300
    6) DEFAULT_FREE_BUFFEROBJ_HOLD    : 900
  2. change  UDP Server default parameters :
    1) DEFAULT_FREE_SOCKETOBJ_POOL    : 150
    2) DEFAULT_FREE_SOCKETOBJ_HOLD    : 450
    3) DEFAULT_FREE_BUFFEROBJ_POOL    : 300
    4) DEFAULT_FREE_BUFFEROBJ_HOLD    : 900

> update instructions:
—————–
1、 HP-Socket v3.1.1 or previous versions for applications can upgrade to HP-Socket v3.1.2 safely

==========================================================================================
v3.1.1 upgrade:
==========================================================================================

> add export the C function’s dynamic link library: HPSocket4C.dll:
—————–

  1. add the code files: HPSocket4C.h and HPSocket4C.cpp,for creating  HPSocket4C.dll
  2. export the C function and make other language(as:C/C#/Delphi etc)to use HPSocket easily
  3. HPSocket4C.dll using methods
    method one:
    ————————————————————————————–
      (0) (C/C++ programs)include HPSocket4C.h header files
    (1) call  ::Create_HP_XxxListener() function to create listener object
    (2) call  ::Create_HP_Xxx(pListener) function to create  HPSocket object
    (3) call  ::HP_Set_FN_Xxx_OnYyy(pListener, …) function to set the call back function of listener
    (4) call export functions to operate HPSocket object
    (5) …… ……
    (6) call  ::Destroy_HP_Xxx(pSocket) function to destory HPSocket object
    (7) call  ::Destroy_HP_XxxListener(pListener) functions to destory the listener object
    method two:
    ————————————————————————————–
    (1) the application need to use the export functions of the package to the specific language class.
    (2) after packaging encapsulated,use HPSocket in the OOP way
  4. HPSocket4C.dll dynamic link library (release version)
    (1) x86/HPSocket4C.dll        – (32bit/MBCS/Release)
    (2) x86/HPSocket4C_D.dll    – (32bit/MBCS/DeBug)
    (3) x86/HPSocket4C_U.dll    – (32bit/UNICODE/Release)
    (4) x86/HPSocket4C_UD.dll    – (32bit/UNICODE/DeBug)
    (5) x64/HPSocket4C.dll        – (64bit/MBCS/Release)
    (6) x64/HPSocket4C_D.dll    – (64bit/MBCS/DeBug)
    (7) x64/HPSocket4C_U.dll    – (64bit/UNICODE/Release)
    (8) x64/HPSocket4C_UD.dll    – (64bit/UNICODE/DeBug)

> start the Buffer Pool caching mechanism:
—————–

  1. Common/Src adds the code file : bufferpool.h and bufferpool.cpp ,and achieve the Buffer Pool caching mechanism
  2. by the Buffer Pool caching mechanism and enhance the efficiency of memory usage,reduce the dynamic memory allocation and release operation and avoid the memory hole
  3. CTcpClient use CItemPool and TItemList to achieve transmit buffer
  4. CUdpClient use CItemPool and TItemList to achieve transmit buffer
  5. CTcpPullClient use CItemPool and TItemList to achieve transmit bufferand PULL bufferand
  6. CTcpPullServer use CBufferPool and TBuffer to achieve PULL bufferand

> other updates :
—————–

  1. IServer adds the interface method DisconnectLongConnections() to disconnect all long connections.
  2. IServer deletes interface method GetConnectionCriSec()
  3. IClient adds methods Get/SetFreeBufferPoolSize()、Get/SetFreeBufferPoolHold() to set the size and threshold of Buffer Pool
  4. IPullServer deletes  methods  Get/SetFreePullBufferPool()、Get/SetFreePullBufferHold()
  5. HPSocket.dll and HPSocket4C.dll use /MT(d) for the options recompile,eliminate dependency on the runtime library
  6. add the TestEcho-4C testing program,show the using methods of HPSocket4C.dll

> update instructions:
—————–

  1. HP-Socket v3.0.2 or previous versions for applications can upgrade to HP-Socket v3.1.1 safely
  2. if you want to import HPSocket4C.dll into the project , see the way of using HP-Socket,refer to the example project TestEcho-4C

==========================================================================================
v3.0.2 update:
==========================================================================================

> HP-Socket complied as a dynamic link library:
—————–

  1. applications can use the HP-Socket by the source code or importing the dynamic link library mode.
  2. dynamic link library using methods
    method one:
    ———————————————————————–
    (0) the application contains the SocketInterface.h and HPSocket.h head files
    (1) call  HP_Create_Xxx() function to create  HPSocket object
    (2) after using the call  HP_Destroy_Xxx() function to destroy HPSocket object
    method two:
    ———————————————————————–
    (0) the application contains the SocketInterface.h and HPSocket.h head files
    (1) create the CXxxWrapper wrapper and use the HPSocket object by the smart pointer wrapper.
  3. dynamic link library(release version)
    (1) x86/HPSocket.dll    – (32bit/MBCS/Release)
    (2) x86/HPSocket_D.dll    – (32bit/MBCS/DeBug)
    (3) x86/HPSocket_U.dll    – (32bit/UNICODE/Release)
    (4) x86/HPSocket_UD.dll    – (32bit/UNICODE/DeBug)
    (5) x64/HPSocket.dll    – (64bit/MBCS/Release)
    (6) x64/HPSocket_D.dll    – (64bit/MBCS/DeBug)
    (7) x64/HPSocket_U.dll    – (64bit/UNICODE/Release)
    (8) x64/HPSocket_UD.dll    – (64bit/UNICODE/DeBug)

> other updates :
—————–

  1. move the component interface and the statement listener to SocketInterface.h
  2. IServer add interface methods GetConnectionCount()/GetConnectPeriod() and  each gets the number of connections and the time of connection.
  3. IServer interface methods GetListenAddress()/GetClientAddress()’s CString& change the parameter to LPTSTR
  4. IClient interface methods GetLocalAddress()’s CString& change the parameter to LPTSTR
  5. the function’s CString& in SocketHelper.h change the parameter to LPTSTR
  6. the example projects: TestEcho-Pull and TestEcho-PFM use HP-Socket by importing the dynamic link library mode

> update instructions:
—————–

  1. HP-Socket v3.0.1 or previous versions for applications can upgrade to HP-Socket v3.0.2
  2. Beacause some parameters of the interface methods have changed ,so please alter it refer to the example project.
  3. if the project want to use HP-Socket by the way of a dynamic link library,please refer to the TestEcho-Pull or TestEcho-PFM example project.

==========================================================================================
v3.0.1 upgrade:
==========================================================================================

> add UDP communication component :
—————–

  1. add two UDP communication components :CUdpServer as the server component and CUdpClient as the client component
  2. server component  CUdpServer use IOCP communication model
  3. client component  CUdpClient use Event Select communication model
  4. UDP communication component Interface is the same of the original TCP communication component ,simple and practical
  5. UDP communication component includes communication line automatic monitoring mechanism
  6. add UDP communication component example project: TestEcho-UDP

> Code refactoring and optimization:
—————–

  1. Specification the name of all Interface、class and code file
  2. Refactoring and optimization a lot of component code
  3. server component add the mechanism of read-write lock,effect balance deal-performance and safety
  4. server component’s Socket object Cache list set locking the time,upgrade the degree of access-safety

> update instructions:
—————–

  1. the Application of using HP-Socket v2.2.3 can safely upgrade to HP-Socket v3.0.1
  2. because of renaming a lot of Interface、class and code file ,so when system upgrading , this need to relevant change

==========================================================================================
v2.2.3 upgrade:
==========================================================================================

> the data type of connect ID change to ‘CONNID’:
—————–

  1. in SocketHelper.h ,it defines as CONNID data type(default:typedef ULONG_PTR CONNID)
  2. Application can make  CONNID defined as it hoped type(eg:ULONG / ULONGLONG …)
  3. order to easy to transplant and aegis,Application’s everywhere should use the‘CONNID’ type quote connect ID

> server  Socket component support as every connection tie attached data:
—————-

  1. IServerSocket and CIocpServer add method  Get/SetConnectionExtra()
  2. Through the above two method ,application can make every connection tie random attached data and take it out

> other updates :
—————–

  1. broaden CIocpServer’s the limit of the number of the biggset IOCP work thread  (64 change to 500)
  2. server  Socket component’s Disconnect()  method adds one marked parametric ‘bForce’,directive whether forcibly disconnect connection
  3. change connect ID’s generate rule , avert generated number is 0 connection ID

==========================================================================================
v2.2.2 upgrade:
==========================================================================================

> optimization heartbeat checking’s interrelated function:
—————–

  1. IServerSocket and IClientSocket ,theirs Get/SetKeepAliveTimes()  method changes to Get/SetKeepAliveTime()
  2. CIocpServer and CClientSocket ,theirs default KeepAliveTime attribute changes to 5000
  3. CIocpServer and CClientSocket ,theirs default KeepAliveInterval attribute changes to 3000

==========================================================================================
v2.2.1 upgrade:
==========================================================================================

> Pull modelsupport :
—————–

  1. ISocketListener add the method for the Pull model to get the data receiving notification :OnReceive(dwConnID, int)
  2. add PULL Socket Interface: IPullSocket,the interface’s Fetch(dwConnID, pBuffer, iLength)  method to catch the data of communication

> Server:
—————–

  1. server  Socket Interface: ISocketServer renamed to IServerSocket
  2. add PULL Server Socket Listrner abstract class: CPullServerSocketListener
  3. add PULL Server Socket Listrner: IPullServerSocket
  4. add PULL Server Socket Implementation class : CIocpPullServer

> Client:
—————–

  1. client  Socket Interface: ISocketClient renamed to IClientSocket
  2. client  Socket Implementation class :CSocketClient renamed to CClientSocket
  3. add PULL Client Socket Listrner abstract class: CPullClientSocketListener
  4. add PULL Client Socket Interface: IPullClientSocket
  5. add PULL Client Socket Implementation class: CPullClientSocket

> other upgrade:
—————–

  1. add PULL Socket testing program: TestEcho-Pull
  2. In the SocketHelper.h (.cpp) there are some structures for help.

> update instructions:
—————–

  1. use HP-Socket v2.1.1 or previous versions for applications can upgrade to v2.2.1 safely
  2. beacause the names of  ISocketServer、ISocketClient and CSocketClient have changed,therefore,the application need to modifie the name and header file name .

==========================================================================================
v2.1.1 upgrade:
==========================================================================================

> Server:
—————–

  1. IServerSocketListener cancel OnPrepareSocket(connID, socket) notification method
  2. IServerSocketListener alter OnAccept((connID, soClient) notification method ,add the parameter :‘soClient’,to achieve the original OnPrepareSocket(connID, socket) notification method function
  3. IServerSocketListener add OnPrepareListen(soListen) notification method ,to set the listerner to the SOCKET Options of socket
  4. ISocketServer add method  GetListenAddress(strAddress, usPort),to get the address information of the listen to Socket
  5. ISocketServer add method  GetClientAddress(connID, strAddress, usPort),for a connection of a client address.
  6. the optimization of Socket buffer pools and the managements of memory block buffer pool.
  7. change the method names for some roperty-accessings
  8. fix bugs : deadlock phenomenon may happen under special circumstances.

> Client:
—————–

  1. ISocketServer add method  GetLocalAddress(strAddress, usPort),for get the  address information of Client Socket.
  2. Optimize the data-transmission mode , and improve the efficiency of data transmission

> other upgrade:
—————–

  1. TestEcho and TestEcho-PFM testing program optimization
  2. in SocketHelper.h (.cpp) , there are some functions for help
  3. for SocketHelper.h ,there are the comments of all interfaces ,classes and methods defined.

==========================================================================================
v2.0.1 upgrade:
==========================================================================================

> Server
—————–

  1. IServerSocketListener add OnPrepareSocket(connID, socket) notice the method  for set the SOCKET Options or filter client connection before using the socket
  2. ISocketServer add method  Disconnect(connID) to disconnect the client connections
  3. add IServerSocketListener’ subclass CServerSocketListener,provide a default(full) notification processing method

> Client:
—————–

  1. IClientSocketListener add OnPrepareSocket(connID, socket) notification method for set the SOCKET Options before using the socket
  2. support asynchronous Connect:ISocketServer  Start() method add one parameter (BOOL bAsyncConnect) set whether to use the asynchronous Connect
  3. add IClientSocketListener subclass: CClientSocketListener,provide default(null)notification handle methods。
  4. repair BUG:appear package loss when  its ultra-high load

> other upgrade:
—————–

  1. support  Windows x64 platform
  2. optimzate TestEcho and TestEcho-PFM testing program.
  3. TestEcho client adds “asychronous connection” program for example.
  4. TestEcho server adds “connection filter” and “initiative disconnect ” programs for example
Comments Are Closed