Agilent Technologies E5071C Guia do Utilizador Página 191

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 551
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 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
Vista de página 190
1 2 ... 186 187 188 189 190 191 192 193 194 195 196 ... 550 551

Comentários a estes Manuais

Vikiehs 04 Jan 2024 | 13:20:06

urenrjrjkvnm