High-performance tcp/udp/http communication Framework Hp-socket v4.0.1 released

Source: Internet
Author: User

  Hp-socket is a general-purpose, high-performance tcp/udp/http communication framework that includes server-side components, client components, and Agent components that are widely used in tcp/udp/http communication systems in a variety of scenarios, providing C/S, C #, Delphi, E (Easy language), Java, Python and other programming language interfaces. Hp-socket completely encapsulates the communication layer, the application does not have to focus on any details of the communication layer, and Hp-socket provides an API interface based on the event notification model, which can be easily and efficiently integrated into the old and new applications.

pull Model example, pack model examples, performance test examples, and other programming language examples). Hp-socket is currently running on the Windows platform and will implement cross-platform support in the future.

  "Hp-socket v4.0 Development Guide"

----------------------------------------------------------------

Versatility

    • Hp-socket's sole responsibility is to receive and send byte streams, not to participate in application protocol resolution.
    • Hp-socket interacts with the application through an interface and is fully decoupled. Any application can seamlessly integrate Hp-socket as long as the Hp-socket interface specification is implemented.

Ease of Use

    • Ease of use is essential for all common frameworks, and it is not as easy to write them as you would if they were too difficult. Therefore, the Hp-socket interface is designed to be very simple and uniform.
    • The hp-socket completely encapsulates all the underlying communication details, and the application does not have to interfere with the underlying communication operations. The communication connection is abstracted to the Connection id,connection ID as the unique identity of the connection provided to the application to handle the different connections.
    • Hp-socket provides push/pull/pack and other receive models, the application can flexibly choose to handle the package in manual, semi-automatic or fully automatic way, the Pull/pack receiving model reduces the complexity of packet processing and greatly reduces the chance of error.

Performance

    • Client component: based on the Event Select communication model, the communication operation is performed in a separate thread to avoid interfering with the main thread or other threads. Each Component object manages a Socket connection.
    • Server components: based on the IOCP communication model, combined with technology such as the cache pool, private heap, and other technologies, to support ultra-large-scale connections, in high-concurrency scenarios to achieve efficient memory management.
    • Agent components: for scenarios such as proxy servers or transit servers, the server itself also initiates large-scale connections to other servers as a client, and an agent Component object can manage multiple Socket connections at the same time; Agent components and server Components use the same technical architecture that can be used as client parts for a proxy server or a staging server.

Elasticity of

Applications can adjust Hp-socket performance parameters (e.g. number of worker threads, size of cache pool, send mode and receive mode, etc.) based on realistic scenarios such as different capacity requirements, communication scale and resource status, and optimize resource allocation to meet application needs without wasting resources.

   (Project homepage: Click here: click here)

v4.0.1 Update * * *

> Add HTTP Series Communication components:

-----------------

  1. New HTTP Server components
    1) Component class: CHttpServer, Chttpsserver
    2) Implement Interface: Itcpserver/icomplexhttpresponder
    3) Listener interface: Ihttpserverlistener
  2. New HTTP Agent Component
    1) Component class: Chttpagent, Chttpsagent
    2) Implement Interface: Itcpagent/icomplexhttprequester
    3) Listener interface: Ihttpagentlistener
  3. New HTTP Client Component
    1) Component class: Chttpclient, Chttpsclient
    2) Implement Interface: Itcpclient/ihttprequester
    3) Listener interface: Ihttpserverlistener
  4. New HTTP Sample Demo
    1) testecho-http (source code)
    2) testecho-http-4c (4C lib/4c DLL)
  5. Http Listener
    1)   Listener event:
     2)   Listener event return value (Enhttpparseresult: 

> Component Interface Adjustment:

-----------------

  1. All listener callback methods for the IServer and iagent components add the ' event source ' parameter, such as: OnShutdown (), OnShutdown (t* psender)
  2. All listener callback methods for the IClient component increase the ' connection id ' parameter, such as: Onhandshake (iclient* pclient), Onhandshake (t* psender, Connid Dwconnid)
  3. IServer and Iagent interface Add interface method: Get/setmaxconnectioncount () to set the maximum number of connections, the maximum number of connections default: 10000
  4. Onhandshake () Event trigger rule adjustment: The non-SSL component also triggers the Onhandshake () event after the OnConnect () event, making the SSL component and the SSL component processing process consistent
  5. Hpsocket4c adds a method for creating and destroying pack component listeners, and the new version must create and destroy pack component listeners using the following methods:
    1) Create_hp_tcppackserverlistener/destroy_hp_tcppackserverlistener
    2) Create_hp_tcppackagentlistener/destroy_hp_tcppackagentlistener
    3) Create_hp_tcppackclientlistener/destroy_hp_tcppackclientlistener
  6. SSL Components Support SNI
    1) SSL initialization Method Hp_ssl_initialize (), add SNI callback function pointer parameter
    2) New Method Hp_ssl_addservercontext () for loading SNI host certificate

> Other updates:

-----------------

    1. IServer and Iagent components use Ring Pool instead of r/w Lock + MAP to maintain active connections for improved read-write and concurrency performance
    2. Update all Demo sample code

* * * v3.5.1 UPDATE * * *

> Add SSL Series Communication components:

-----------------

  1. New SSL PUSH components: Csslserver, csslagent, Csslclient
  2. New SSL Pull components: Csslpullserver, csslpullagent, Csslpullclient
  3. New SSL PACK components: Csslpackserver, csslpackagent, Csslpackclient
  4. SSL Server implements Itcpserver interface, SSL Agent implements Itcpagent interface, SSL Client implements Itcpclient interface
  5. you need to call the Hp_ssl_initialize () function to initialize the SSL Global environment parameter before starting the SSL communication component
  6. Call the Hp_ssl_cleanup () function to clean up the SSL Global runtime environment after communication ends
  7. New SSL-related example Demo:
    1) Testecho-ssl (source code) 2) testecho-ssl-pack (dll/4c DLL) 3) testecho-ssl-4c (4C Lib) 4) TESTECHO-SSL-PFM (Lib)

> Component Interface Adjustment:

-----------------

  1. Itcpserverlistener interface increased SSL handshake Success Event: Onhandshake (Connid Dwconnid)
  2. Itcpagentlistener interface increased SSL handshake Success Event: Onhandshake (Connid Dwconnid)
  3. Itcpclientlistener interface increased SSL handshake Success 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 operating mode), Ensslverifymode (SSL authentication mode)
  6. Hpsocket-ssl DLL Primary header file: socketinterface-ssl.h,hpsocket-ssl.h
  7. Hpsocket4c-ssl DLL Primary header file: hpsocket4c-ssl.h
  8. TCP Pack Series components can be set to a maximum package length adjustment of 4194303/0x3fffff bytes
  9. The effective header identification value range of TCP Pack series components is adjusted to 0 ~ 1023/0X3FF

> Add Static Library project:

-----------------

    1. New Project Engineering Hpsocketlib and HPSOCKETLIB4C for compiling hpsocket and hpsocket4c static libraries
    2. Static libraries are used in the same way as dynamic libraries (refer to examples demo:testecho-ssl-4c and TESTECHO-SSL-PFM)
    3. When working with Hpsocket or hpsocket4c static libraries, you need to define the preprocessing macros, and so on in the project properties Hpsocket_static_lib
    4. The static library destination file is not included in the release package (because it is too large), and if necessary, compile it yourself

v3.4.4 Update * * *

> Add TCP Pack Series Communication components:

-----------------

    1. The TCP Pack Series component guarantees that each OnReceive event provides a complete packet to the application
    2. TCP Pack Series components are a combination of the push/pull pattern, where applications do not have to process subcontracting (e.g. PUSH) and data fetching (e.g. pull)
    3. The TCP Pack Series components provide the Get/setmaxpacksize () and Get/setpackheaderflag () methods to set the maximum packet length and header identification
    4. Ctcppackserver implements Itcpserver interface, Ctcppackagent implements Itcpagent interface, Ctcppackclient implements Itcpclient interface

> Component Interface Adjustment:

-----------------

    1. Onclose/onerror merged into one communication event: OnClose (Connid Dwconnid, ensocketoperation enoperation, int ierrorcode)
    2. Enumeration Type Ensocketoperation adds an enumeration value: So_close = 5, identifies the close Socket operation
    3. IServer and Iagent Interface Removal interface method: Get/setrecvpolicy ()
    4. IServer and Iagent Interface Removal interface method: Get/setmaxshutdownwaittime ()

> Bug Fixes:

-----------------

    1. Fix the TCP Pack Agent "Asynchronous connection failure causes program crash" Bug
    2. Fix vc-common-src Common code package Ccasqueue may cause an infinite loop Bug

High-performance tcp/udp/http communication Framework Hp-socket v4.0.1 released

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.