CSocket.connect 方法 |
命名空间: VO
1FUNCTION Start 2 IF CheckRemote("mail2.cai.com", IPPORT_SMTP, 1000) 3 ? "CA's mail server is available" 4 ELSE 5 ? "Mail server currently not accessible" 6 ENDIF 7 8FUNCTION CheckRemote (cServer AS STRING, nPort AS INT, nTimeout AS INT); AS LOGIC PASCAL 9 LOCAL oSocket AS CSocket 10 LOCAL lRet AS LOGIC 11 12 oSocket := CSocket{SOCK_STREAM} 13 oSocket:TimeOut := nTimeout 14 15 lRet := oSocket:connect(cServer, nPort) 16 oSocket:Close() 17 18 RETURN lRet