14.06.2014 Views

R&S WinIQSIM2 Software Manual - Rohde & Schwarz

R&S WinIQSIM2 Software Manual - Rohde & Schwarz

R&S WinIQSIM2 Software Manual - Rohde & Schwarz

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

R&S ® <strong>WinIQSIM2</strong><br />

Automation of R&S <strong>WinIQSIM2</strong><br />

Remote Control Basics<br />

is in progress, or the service provider is still processing a callback function.")<br />

; break;<br />

case WSAEFAULT: throw string<br />

(" The name parameter is not a valid part of the user address space."); break;<br />

case WSAEINTR: throw string<br />

(" A blocking Windows Socket 1.1 call was canceled through case<br />

WSACancelBlockingCall."); break;<br />

}<br />

#endif<br />

currentHostName = "";<br />

currentPort = 0;<br />

currentHostInfo = NULL;<br />

clientIsConnected = false;<br />

throw string("error connecting host\n" );<br />

}<br />

else<br />

{<br />

currentHostName = hostname;<br />

currentPort = port;<br />

currentSocketDescr = socket(AF_INET, SOCK_STREAM, 0);<br />

if( currentSocketDescr == 0 )<br />

{<br />

currentHostName = "";<br />

currentPort = 0;<br />

currentHostInfo = NULL;<br />

clientIsConnected = false;<br />

throw string("can't create socket\n" );<br />

}<br />

serverAddress.sin_family = currentHostInfo->h_addrtype;<br />

serverAddress.sin_port = htons( currentPort );<br />

memcpy( (char *) &serverAddress.sin_addr.s_addr, currentHostInfo-><br />

h_addr_list[0], currentHostInfo->h_length );<br />

if( connect( currentSocketDescr, ( struct sockaddr *) &serverAddress,<br />

sizeof(serverAddress ) ) < 0 )<br />

{<br />

throw string("can't connect server\n" );<br />

}<br />

clientIsConnected = true;<br />

}<br />

}<br />

void TcpClient::disconnect( )<br />

{<br />

if( clientIsConnected )<br />

{<br />

#ifndef LINUX<br />

closesocket( currentSocketDescr );<br />

#else<br />

close( currentSocketDescr );<br />

#endif<br />

<strong>Software</strong> <strong>Manual</strong> 1008.0858.42 ─ 10<br />

140

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!