"DIOCP Knowledge Base" Connection context Tiocpclientcontext

Source: Internet
Author: User

Overview

This class manages remote connections, and each remote connection corresponds to an instance of that class, which can be developed by inheriting the class, extending the properties, storing more connection information, and overriding the Onrecvbuffer method for data logic processing

"Field/Property description"

    • Property remoteaddr:string read fremoteaddr;

Description: Remote connection IP.

    • Property Remoteport:integer read Fremoteport;

Description: Remote connection port.

    • Property Sockethandle:tsocket read Fsockethandle;

Description: Connect the socket.

"Method description"

    • Procedure docleanup;virtual;

Description: This method executes the method when it obtains an object from the object pool (Tiocptcpserver.getclientcontext), performs cleanup of the related resources, and when the instance is no longer needed, is put back into the connection pool ( Tiocptcpserver.releaseclientcontext) also executes the method, which accesses and executes only one thread at a time.

    • Procedure Postnextsendrequest; Virutal;

Note: The method will be called again to send the next request when the request is completed and successful (Tiocpsendrequest.handleresponse). The method will not be executed if the response finds that GetLastError is not 0 or if the service shutdown has stopped

    • Procedure Onrecvbuffer (buf:pointer; len:cardinal; Errcode:word); Virtual

Description: If the execution of the function is triggered when the remote data is received, the method is called in response to a request to receive data from a post (tiocprecvrequest.handleresponse). The method is not executed if the response finds that GetLastError is not 0 or if the service shutdown has stopped.

==========================================

DIOCP Official Community | Mybean Official Community

http://www.diocp.org/

==========================================

"DIOCP Knowledge Base" Connection context Tiocpclientcontext

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.