This is an old revision of the document!


Communication API > BS2_SetSocketSSLRetryCount


[+ 2.9.1] During SSL socket communication, if an error occurs while reading and writing packets from the socket in the communication section, the SDK automatically retries a certain number of times.
This API can change the number of retries.

CAUTION
Increasing the number of retries is a good solution to resolve temporary errors,
but be careful as it can waste resources by retrying meaningless reads/writes when reconnecting is required due to direct causes, such as network disconnection.

Declaration

#include "BS_API.h"
 
int BS2_SetSocketSSLRetryCount(void* context, uint32_t count);

Parameter

  • [In] context : Context
  • [In] count : Retry count setting value

Return Value

If successfully done, BS_SDK_SUCCESS will be returned. If there is an error, the corresponding error code will be returned.

See Also

Sample Code(C++)

sample_setdebugfilelogex.cpp
const char* CURRENT_DIR = ".";
const int MAX_SIZE_LOG_FILE = 100;  // 100MB
int sdkResult = BS2_SetDebugFileLogEx(DEBUG_LOG_ALL, DEBUG_MODULE_ALL, CURRENT_DIR, MAX_SIZE_LOG_FILE);
if (BS_SDK_SUCCESS != sdkResult)
{
	printf("BS2_SetDebugFileLogEx call failed: %d", sdkResult);
	return;
}

Sample Code (C#)

sample_setdebugfilelogex.cs
const string CURRENT_DIR = ".";
const int MAX_SIZE_LOG_FILE = 100;  // 100MB
IntPtr ptrDir = Marshal.StringToHGlobalAnsi(CURRENT_DIR);
result = (BS2ErrorCode)API.BS2_SetDebugFileLogEx(Constants.DEBUG_LOG_OPERATION_ALL, Constants.DEBUG_MODULE_ALL, ptrDir, MAX_SIZE_LOG_FILE);
Marshal.FreeHGlobal(ptrDir);
if (result != BS2ErrorCode.BS_SDK_SUCCESS)
{
	Console.WriteLine("Got error({0}).", result);
	return;
}