Skip to content

Conversation

@Tim-S
Copy link
Contributor

@Tim-S Tim-S commented Jun 17, 2024

added simple signaling-server implemented using libdatachannel cpp-api

@Tim-S Tim-S force-pushed the examples/signaling-server-libdatachannel-ws branch from 694689b to 7c04028 Compare June 17, 2024 22:21
added simple signaling-server implemented using libdatachannel cpp-api
@Tim-S Tim-S force-pushed the examples/signaling-server-libdatachannel-ws branch from 7c04028 to 8e3ba51 Compare June 17, 2024 22:24

// Check command line arguments.
for (int i = 1; i < argc; i++) {
if (strcmp(argv[i], "--help") == 0) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not mix C functions in C++ when it is not necessary. Use std::string.

for (int i = 1; i < argc; i++) {
if (strcmp(argv[i], "--help") == 0) {
const size_t len = strlen(argv[0]);
char *path = (char *)malloc(len + 1);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, you should use new[], or better way, std::string.


char *app_name = NULL;
// app_name = last_path_segment(path, "\\/");
fprintf(stderr,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, you should use std::cout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants