EasyManua.ls Logo

Agilent Technologies E5071C - Page 1068

Agilent Technologies E5071C
2685 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Programming
1295
RecvAscii = RECV_ERROR '............(1)
dataBuf = Chr$(0) '
Exit Function '
End If '
If c = Chr$(10) Then '
dataBuf = dataBuf + Chr$(0) '............(2)
RecvAscii = NO_ERROR '
Exit Function '
End If '
length = length + count '............(3)
dataBuf = dataBuf + c '
Wend
RecvAscii = RECV_ERROR
End Function
Disconnection
The procedure corresponding to Disconnection is CloseConnection.
CloseConnection disconnects communication and removes a socket using
the closesocket function of WinSock API. The closesocket function takes a
socket descriptor (input) as its parameter.
c
Sub CloseConnection()
x = closesocket(socketId)
If x = SOCKET_ERROR Then
MsgBox ("ERROR: closesocket = " + Str$(x))
Exit Sub
End If
End Sub
End
The procedure corresponding to End is EndIt. EndIt disconnects WinSock
API using the WSACleanup function of WinSock API. The function
WSACleanup should always be used when terminating WinSock.
EndIt
Sub EndIt()

Table of Contents