Winsock problem: SendComplete event missing in VB6 
Author Message
 Winsock problem: SendComplete event missing in VB6

I'm building a simple Web server interface to an existing program as an
ActiveX DLL (on NT4, using VB6 and the MS Winsock Control 6.0 -- the
existing program is largely in VB).  The server does a normal server
thing, opens a port to listen on, establishes a connection, receives
HTTP requests on the connection, builds a response (based on interfaces
with the rest of the program) and sends it back, then closes the socket
when the SendComplete event occurs.

It's been pretty straightforward, but I run into the following problem:
it seems that if the SendComplete event occurs while the program is busy
doing something else (like responding to an independent HTTP request),
the event doesn't get delivered!  So the socket doesn't get closed and
the browser hangs, waiting for some indication that it's request is
complete.  Debug printouts seem to confirm this explanation.  (In the
IDE, if I pause in this hung state and then re-start, the events all
seem to get delivered, too -- but that obviously isn't a solution except
during debugging!  And the same behaviour occurs when the DLL is run
separately.)  This situation is virtually guaranteed to occur, for
example, when displaying a page with a lot of frames or several gif's,
because they cause a bunch of independent and roughly simultaneous
requests to occur, especially with Netscape browsers.

Have others seen this problem, or is it likely a misunderstanding I have
or something I'm doing wrong (I don't claim to be a particularly
experienced VB programmer)?  Is there a workaround?  I'm about ready to
begin programming this in C/C++, I can't really think of another
approach, but it sounds like such an obvious thing that the Winsock
control should do that I thought I'd give at least give it one more try.

Thanks in advance for your help.

  -- Ray Ellis



Mon, 29 Apr 2002 03:00:00 GMT  
 Winsock problem: SendComplete event missing in VB6
That happened to me and is still happening in my program.  But since I too
close the connection after that event, I simply put use a time out function.


Quote:
> I'm building a simple Web server interface to an existing program as an
> ActiveX DLL (on NT4, using VB6 and the MS Winsock Control 6.0 -- the
> existing program is largely in VB).  The server does a normal server
> thing, opens a port to listen on, establishes a connection, receives
> HTTP requests on the connection, builds a response (based on interfaces
> with the rest of the program) and sends it back, then closes the socket
> when the SendComplete event occurs.

> It's been pretty straightforward, but I run into the following problem:
> it seems that if the SendComplete event occurs while the program is busy
> doing something else (like responding to an independent HTTP request),
> the event doesn't get delivered!  So the socket doesn't get closed and
> the browser hangs, waiting for some indication that it's request is
> complete.  Debug printouts seem to confirm this explanation.  (In the
> IDE, if I pause in this hung state and then re-start, the events all
> seem to get delivered, too -- but that obviously isn't a solution except
> during debugging!  And the same behaviour occurs when the DLL is run
> separately.)  This situation is virtually guaranteed to occur, for
> example, when displaying a page with a lot of frames or several gif's,
> because they cause a bunch of independent and roughly simultaneous
> requests to occur, especially with Netscape browsers.

> Have others seen this problem, or is it likely a misunderstanding I have
> or something I'm doing wrong (I don't claim to be a particularly
> experienced VB programmer)?  Is there a workaround?  I'm about ready to
> begin programming this in C/C++, I can't really think of another
> approach, but it sounds like such an obvious thing that the Winsock
> control should do that I thought I'd give at least give it one more try.

> Thanks in advance for your help.

>   -- Ray Ellis



Tue, 30 Apr 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. winsock UDP problem - SendComplete Event won't fire

2. winsock sendcomplete event question

3. Winsock- UDP - SendComplete ?

4. VB6 missed events.

5. VB6 ListView missing MouseUp Event

6. IE Automation MSHTML - Document object - Missing events problem.

7. Winsock events problem

8. VB5 and Winsock Error event problems

9. WinSock problem, Api-Sleep Function blocks the DataArrival-Event

10. winsock control connection method and close event problem

11. Problem with Winsock Events

12. A problem about DataArrival event in winsock control

 

 
Powered by phpBB® Forum Software