Building page after TCP connection

Results 1 to 3 of 3

Thread: Building page after TCP connection

  1. #1
    Joe Duncan Guest

    Default Building page after TCP connection

    Hello, I am working on integrating a TELNET control into an ActiveX dll to use as a component on an ASP page. The problem is, I need the component to connect to the legacy app via telnet (using the PowerTCP telnet control) and then when it gets connected to print the received text as a webpage. Now the Telnet control that is incorporated into my component uses an event to tell if something has been received. What I have done is included in the Telnet control&#039s receive even a line like so:<BR><BR> MyResponse.write(recvData)<BR><BR>Where recvData is the string received. This does not work. How can I get my component to print the webpage, *after* it receives data???

  2. #2
    Ryan S Guest

    Default RE: Building page after TCP connection

    One idea would be to have a status property. This status property is flagged if data is recieved. Let&#039s say on the Power TCP component, it has an event rcvData. That event is flagged the moment it recieves data. Then this is what it would look like-<BR><BR>Private Sub pTCP_rcvData<BR> myVar = 1<BR> myData = data<BR>End Sub<BR><BR>Public Property Get Var() as Variant<BR> Var = myVar<BR>End Property<BR><BR>Public Property Get Data() as Variant<BR> Data = myData<BR>End Property<BR><BR>Then the ASP page does this<BR><BR>&#039create component<BR>&#039call sub to initiate data<BR>Do while myComponent.Var &#060;> 1<BR>Loop<BR>myData = myComponent.data<BR><BR>That will keep your ASP page waiting to write the response until the component you wrote get&#039s data from the PowerTCP component. Then it set&#039s property flags, and the ASP page downloads that data.<BR><BR>Hope that helps<BR><BR>God bless from Ryan S<BR>mmffml@fetchmail.com

  3. #3
    Joe Duncan Guest

    Default RE: Building page after TCP connection

    Thanks. That approach got it to work, but now there&#039s questions about scalability as this involves a "busy-wait" loop. Does anyone know another approach to this problem that does not involve a "busy-wait" loop?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •