General information
Category:
ActiveX controls in VFP
I was working exactly on the same type of problem yesterday, I have posted a file in the file section. It is called WinSckSvr.Zip, it contains a class to wrap the server side connections to Winsock. It should be available soon since i just posted it.
>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?
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only