Example: lrs_set_socket_handler

In the following example, lrs_set_socket_handler switches the socket handlers of socket0 and socket1.

int socket0_handler=0, socket1_handler=0;
lrs_create_socket("socket0", "UDP", LrsLastArg);
socket0_handler=lrs_get_socket_handler("socket0");
lrs_create_socket("socket1", "UDP", "LocalHost=0", "RemoteHost=localhost:1496", LrsLastArg);
socket1_handler=lrs_get_socket_handler("socket1");
lrs_set_socket_handler("socket1", socket0_handler);
lrs_set_socket_handler("socket0", socket1_handler);
return 0;