Agilent Technologies E5071C Guide de l'utilisateur Page 191

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 551
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 190
Chapter 12 191
Sample Application Programs
Controlling Using Telnet Server
12. Sample Application
Programs
Disconnection
The procedure corresponding to Disconnection is CloseConnection (Example 12-12).
CloseConnection disconnects communication and removes a socket using closesocket
function of
WinSock API. closesocket function takes a parameter for a socket
descriptor (input).
Example 12-12 CloseConnection
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 (Example 12-13). EndIt disconnects
WinSock API using WSACleanup function of WinSock API. The function
WSACleanup should be always used when terminating WinSock.
Example 12-13 EndIt
Sub EndIt()
'Shutdown Winsock DLL
x = WSACleanup()
End Sub
Vue de la page 190
1 2 ... 186 187 188 189 190 191 192 193 194 195 196 ... 550 551

Commentaires sur ces manuels

Vikiehs 04 Jan 2024 | 13:20:06

urenrjrjkvnm