Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Winsock Control Send Error
Message
From
14/06/2001 12:02:59
Josh Fedke
National Financial Corporation
Milwaukee, Wisconsin, United States
 
 
To
12/06/2001 11:48:54
Josh Fedke
National Financial Corporation
Milwaukee, Wisconsin, United States
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00518445
Message ID:
00519459
Views:
14
Hello:

It's Josh again. I'm still having the same problems with the client, but I am having problems with the server, too. One thing I forgot to mention is that when I starting building the server and client, the client would not work when I inserted the graphical control (.ocx). So I implemented the server graphically, and the client in code. This worked until I tried to do multiple sends (see first message). The server was also getting errors, so I implemented the server non-graphically, as well. Using Stephane Hamel's Winsock server code as an example, I implemented this way. I have a main container which has a MSWinsock.Winsock.1 object which simply listens for connection requests. Using's vfpcom's bindevents I am able to override MSWinsock's events and bind them to my winsock object. Every time a connection request comes in, an instance of a different container is added to the main container. This new container instance has another Winsock object which will recieve the data and handle it appropriately (again with event overrides and a vfpcom bindevents). This design seems solid to me, and works, for random amounts of time. But what happens sometimes (I've watched this in the debugger, btw) is that the code adds an container object (with an data-accepting socket and events object) to the main container (The code adds one of these to the main container for every connection) then accepts the request. This works fine, I can see this recently-added object in the main container. I then execute the accept, and the data arrival event fires instantly as the client tries to send it's string. When this happens the object I just added to the main container no longer exists! The debugger says "Could not Evaluate Expression" and an explicit reference says the same thing. I can't figure out why sometimes the object is no longer in the main container. The Destroy code wasn't called, because I had the debugger on and it didn't jump to the destroy code. Is this some sort of "Foxpro doesn't handle OLE events very well" type of thing? Any thoughts? Thanks.

---------------------
| nfcWinsock (Container)
---------------------
| oVfpCom (VfpCom)
| oListenner (MSWinsock.Winsock.1)
| oListennerEvents (WinsockEvents)
|
| ---------------------
| | Winsock_Accepter(x) (Container) (x dynamically assigned 1-no. current connections)
| ---------------------
| | oSocket (MSWinsock)
| | oEvents (WinsockEvents)
| |---------------------
|-----------------------

------------------------
| Winsock_Events
------------------------
| procedure DataArrival
| ...
| endproce
|
| procedure ConnectionRequest
| ...
| endproc
|
| ...
|------------------------------


-Josh
Previous
Reply
Map
View

Click here to load this message in the networking platform