VISCA Camera Control Instructions
DOC-USR-0115-01 DRAFT
___________________________________________________________________________________________
Z3 Technology, LLC
♦
100 N 8
th
ST, STE 250
♦
Lincoln, NE 68508-1369 USA
♦
+1.402.323.0702
12
//open the device in non-blocking way (read will return immediately)
if (argc == 1)
{
usage();
exit(-1);
}
else
{
int portno = 1000, n;
struct sockaddr_in serv_addr;
WSADATA wsa;
printf("\nInitialising Winsock...");
if (WSAStartup(MAKEWORD(2, 2), &wsa) != 0)
{
printf("Failed. Error Code : %d", WSAGetLastError());
return -1;
}
//open tcp socket
s = socket(AF_INET, SOCK_STREAM, 0);
if (s == INVALID_SOCKET)
{
printf("error opening socket : %d\n", WSAGetLastError());
return -2;
}
printf("connecting to %s:%s\n", argv[1], argv[2]);
if (argv[2] != NULL)
{
portno = strtoul(argv[2], NULL, 10);
}
memset((char *) &serv_addr, 0,sizeof(serv_addr));
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = inet_addr(argv[1]);