Share this page

# Example: lrs_get_socket_attrib

In the following example, lrs_get_socket_attrib retrieves the IP address of the peer machine.

    char *peer;

    lrs_receive("socket2", "buf20", LrsLastArg);

    /* Get the size and location of the data within the buffer. */

    peer =lrs_get_socket_attrib("socket2", REMOTE_ADDRESS );

    lr_output_message("The IP address of the remote host is:%s\n", peer);

The output generated by the above code, as seen in the VuGen execution log is:
Message from run.c(32): The IP address of the remote host is:199.203.74.235

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: