Login Page - Create Account

Support Board


Date/Time: Mon, 25 Nov 2024 09:24:20 +0000



Post From: TCP/IP Server in custom study

[2024-03-22 05:55:57]
Userdzungdo - Posts: 3
void run(SCStudyInterfaceRef sc) {

if (running.load() == true)

return;

context = zmq::context_t();

socket = zmq::socket_t(context, zmq::socket_type::rep);

p_interface = ≻

running.store(true);

set_endpoint();

socket.bind(zmq_endpoint);

std::this_thread::sleep_for(1000ms);



job_done = std::async(std::launch::async, [this]() {async_proc(); });

}

To Whom It May Concern
There are some mistake in this code, I guest because of HTML endcode.
We need to fix to make it run

p_interface = ≻

and

void fill_date_time_data(zmq::message_t& msg) {

std::size_t array_size = p_interface->BaseDateTimeIn.GetArraySize();

std::size_t buffer_size = array_size * sizeof(std::time_t);

msg.rebuild(buffer_size);

auto buffer = static_cast<std::byte*>(msg.data());

std::int32_t sc_index = 0;



while (sc_index < array_size) {

std::time_t timestamp = p_interface->BaseDateTimeIn[sc_index].ToUNIXTime();

memcpy(buffer + sizeof(std::time_t)*sc_index,

reinterpret_cast<const std::byte*>(×tamp),

sizeof(std::time_t));

sc_index++;

}

}

reinterpret_cast<const std::byte*>(timestamp ),