Information générale
Catégorie:
Contrôles ActiveX en VFP
I make server-client messenger program with winsock ocx.
1. I'm coding server side form init event,
thisform.winsock1.localport=7000
thisform.winsock1.listen
2.I'm coding server side form connectionrequest event,
ThisForm.winsock1.Accept(requestid)
3.I'm coding server side form dataarrival event,
cRecvData = ""
This.GetData(@cRecvData, 8, bytestotal)
wait wind cRecvData nowait
4. I'm coding client side form init event,
ThisForm.winsock1.RemoteHost = "xxx.xxx.xxx.xxx"
ThisForm.winsock1.Remoteport = 7000
If ThisForm.winsock1.State<>0
ThisForm.winsock1.OBJECT.Close()
EndIf
ThisForm.winsock1.OBJECT.Connect()
If ThisForm.winsock1.State=7
wait wind "connected!" nowait
else
wait wind "NO connected" nowait
endif
ThisForm.winsock1.SendData("test")
ThisForm.winsock1.OBJECT.Close()
But, when client side coding is processing,
=> ThisForm.winsock1.OBJECT.Connect()
server side form send error message like this,
"OLE IDispatch exception code 0 from winsock: Invalid operation at current
state.... "
what's problem?
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement