I noticed that in the us_create_socket_context function in context.c you allocated memory for us_socket_context_t + context_ext_size so I assume in the call to us_socket_ext you're doing some arithmetic like pointer+=sizeof(us_socket_context_t) and returning the pointer to the allocated structure the user is expecting or class object. Whatever it may be. But if that's the case then why is the call to
Passed with sizeof(struct echo_context) if echo_context itself is empty.
Shouldn't the call have been with sizeof(struct echo_socket) instead? Since the example uses us_socket_ext to retrieve a pointer to echo_socket not echo_context...
I noticed that in the
us_create_socket_context
function in context.c you allocated memory for us_socket_context_t + context_ext_size so I assume in the call tous_socket_ext
you're doing some arithmetic like pointer+=sizeof(us_socket_context_t) and returning the pointer to the allocated structure the user is expecting or class object. Whatever it may be. But if that's the case then why is the call toPassed with sizeof(struct echo_context) if echo_context itself is empty. Shouldn't the call have been with sizeof(struct echo_socket) instead? Since the example uses us_socket_ext to retrieve a pointer to echo_socket not echo_context...