Fixed not setting output int to 0 to specify zero connections when
returning connection IDs.
ntohs(receivedData.sin6_port),
", packet id = ", seqID,
", good mode = ", iter->second.flags.test(1) ? "yes" : "no",
- isPing ? ", ping" : "");
+ isPing && !isConnect ? ", ping"
+ : (isPing && isConnect ? ", disc" : ""));
// check if is delete
if(isConnect && isPing) {
std::lock_guard<std::mutex> lock(c->mutex);
if(c->conMap.empty()) {
+ if(size) {
+ *size = 0;
+ }
return nullptr;
}
if(size) {
UDPC_set_accept_new_connections(context, 0);
puts("Dropping all connections...");
- UDPC_ConnectionId *ids = UDPC_get_list_connected(context, NULL);
+ UDPC_ConnectionId *ids = UDPC_get_list_connected(context, &temp);
UDPC_ConnectionId *current = ids;
- while(current->scope_id != 0 && current->port != 0) {
+ while(temp > 0) {
UDPC_drop_connection(context, *current, 0);
++current;
+ --temp;
}
UDPC_free_list_connected(ids);