Agilent Technologies E5071C Uživatelská příručka Strana 191

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 551
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 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
Zobrazit stránku 190
1 2 ... 186 187 188 189 190 191 192 193 194 195 196 ... 550 551

Komentáře k této Příručce

Vikiehs 04 Jan 2024 | 13:20:06

urenrjrjkvnm