Dynamic buffering for network data transmission function

Source: Internet
Author: User

Anychat with buffer and file transfer function, it can realize buffer and file transfer between client and client, and can realize buffer and file transfer between client and server ( V4.1 version of the new feature).

Anychat the buffers and file transfer channels between the clients are:

1 , transparent channels API Interface: Brac_transbuffer ;

2 , transparent channel expansion API Interface: Brac_transbufferex ;

3 , File transfer API Interface: Brac_transfile ;

Anychat the buffer and file transfer channels between the client and the server are:

1 , sdkfilter Data API Interface: Brac_sendsdkfilterdata , Bras_sendbuftouser , Bras_sendbuftoroom ;

2 , transparent channels API Interface: Brac_transbuffer , Bras_transbuffer ;

3 , transparent channel expansion API Interface: Brac_transbufferex , Bras_transbufferex ;

4 , File transfer API Interface: Brac_transfile , Bras_transfile ;

I. Transfer of data between clients using transparent channels

A,Btwo when the user logs on to the server successfully, the transparent channel can be usedAPIinterface to transmit data whenAUseAPIInterface:Brac_transbuffertoBwhen sending data,Bwhen the data is received, it triggersBthe callback function:Transparent channel data callback function(Refer to:Brac_settransbuffercallback).

Kernel Use TCP channel transmission, to ensure that the receiving Party received the same order and send the order, and ensure that the data can be reached, will not lose packets;

Second, the client uses transparent channel extension to transmit data

A,Btwo when the user logs on to the server successfully, the transparent channel extension is usedAPIinterface to transmit data whenAUseAPIInterface:Brac_transbufferextoBwhen sending data,Bwhen the data is received, it triggersBthe callback function:Transparent channel data extension callback function(Refer to:Brac_settransbufferexcallback).

Kernel Use UDP channel transmission, does not guarantee that the receiving party receives the same order as the sending order, but ensures that the data can be reached, the packet is automatically re-transmitted;

Iii. transfer of files between clients

A,Btwo when the user logs on to the server, the file transfer can be usedAPIinterface to transfer files whenAUseAPIInterface:Brac_transfiletoBwhen you send a file,Bwhen a file is received, it triggersBthe callback function:File Transfer callback function(Refer to:Brac_settransfilecallback)

Kernel Use UDP channel transmission, does not guarantee that the receiving party receives the same order as the sending order, but ensures that the data can be reached, the packet is automatically re-transmitted;

iv. transfer of buffer data between client and server ( SDK Filter Data interface)

Client A after the logon server succeeds, you can use the SDK Filter Data interface transmits data

1 , when the client uses API interface: brac_ Sendsdkfilterdata upper layer business custom data callback function definition (reference: bras_setonrecvuserfilterdatacallback Span style= "COLOR: #444444" >)

2 , when the server uses API Interface: Bras_sendbuftouser , Bras_sendbuftoroom when data is sent to the client, the client's callback function is triggered: SDK Filter Communication Data callback function (Refer to: Brac_setsdkfilterdatacallback )

Kernel Use TCP channel transmission, to ensure that the receiving Party received the same order and send the order, and ensure that the data can be reached, will not lose packets;

V. Transfer of buffer data between client and server (transparent channel interface)

Client A after the logon server succeeds, you can use the transparent channel interface to transfer data to the server

1 , when the client uses API Interface: Brac_transbuffer The server's callback function is triggered when data is sent to the server: Transparent channel data callback function

(Refer to: Bras_settransbuffercallback )

2 , when the server uses API Interface: Bras_transbuffer when data is sent to the client, the client's callback function is triggered: Transparent channel data callback function ;

Kernel Use TCP channel transmission, to ensure that the receiving Party received the same order and send the order, and ensure that the data can be reached, will not lose packets;

(Note: SDK Filter Data interface and transparent channel interface efficiency is the same, transparent channel interface is mainly for the client-compatible API and designed for V4.1 version Server new interface, it should be noted that the corresponding callback function is different)

Vi. transfer of data between client and server using an extended buffer channel

Client A after the logon server succeeds, you can use the extended buffer channel to transfer data to the server

1 , when the client uses API Interface: Brac_transbufferex The server's callback function is triggered when data is sent to the server: Transparent channel data extension callback function (Refer to: bras_settransbufferexcallback)

2 , when the server uses API Interface: Bras_transbufferex when data is sent to the client, the client's callback function is triggered when the data is received by the clients: Transparent channel data extension callback function (Refer to: Brac_settransbufferexcallback ).

Kernel Use UDP channel transmission, does not guarantee that the receiving party receives the same order as the sending order, but ensures that the data can be reached, the packet is automatically re-transmitted;

Vii. transferring files between client and server

Client A after the logon server succeeds, you can use the file transfer interface to transfer files to the server

1 , when the client A Use API Interface: Brac_transfile when a file is sent to the server, the server-side callback function is triggered when the server receives the file: File Transfer callback function (Refer to: bras_settransfilecallback);

2 , when the server uses API Interface: Bras_transfile when a file is sent to the client, the client's callback function is triggered when the client receives the file data: File Transfer callback function (Refer to: Brac_settransfilecallback );

Kernel Use UDP channel transmission, does not guarantee that the receiving party receives the same order as the sending order, but ensures that the data can be reached, the packet is automatically re-transmitted;

Note: The above mentioned " Server " refers to the use anychat Server SDK The business-tier server being developed.

Dynamic buffering for network data transmission function

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.