Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide 129
Programming Examples
LAN Programming Interface Examples
}
#endif /* WINSOCK */
/******************************************************************
*
> $Function: openSocket$
*
* $Description: open a TCP/IP socket connection to the instrument
$
*
* $Parameters: $
* (const char *) hostname . . . . Network name of instrument.
* This can be in dotted decimal
notation.
* (int) portNumber . . . . . . . The TCP/IP port to talk to.
* Use 5025 for the SCPI port.
*
* $Return: (int) . . . . . . . . A file descriptor similar to
open(1).$
*
* $Errors: returns -1 if anything goes wrong $
*
******************************************************************/
SOCKET openSocket(const char *hostname, int portNumber)
{
struct hostent *hostPtr;
struct sockaddr_in peeraddr_in;
SOCKET s;
memset(&peeraddr_in, 0, sizeof(struct sockaddr_in));
Summary of Contents for X-Series
Page 4: ...4 ...
Page 10: ...10 Contents ...