Results 1 to 5 of 5

Thread: Proxy Server

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Melbourne, Victoria, Australia
    Posts
    126

    Post

    Guys and Gals,

    Ive made my own proxy server which works like a dream, but when the browser starts to do multiple connections for like images etc... when it does more than 1 connection, it cant connect any more cos the winsock can only accept 1 connect at a time

    Anyone know how to make it allow multiple connections at the same time?

    Like 8 con-current connections on the same port?

    ------------------
    Regards,

    Paul Rivoli
    -------------------
    [email protected]
    http://users.bigpond.com/privoli

  2. #2
    Guest

    Post

    This what you are looking for?
    It only handles the connect's and disconnect's but it should help you start.

    Code:
    Option Explicit
    
    Private Sub Form_Load()
        sckTest(0).LocalPort = 23   'Telnet easy to test with
        sckTest(0).Listen
    End Sub
    
    Private Sub sckTest_ConnectionRequest(Index As Integer, ByVal requestID As Long)
        'Add new connection
        'Load new winsock and accept
        Load sckTest(sckTest.UBound + 1)
        sckTest(sckTest.UBound).LocalPort = 0
        sckTest(sckTest.UBound).Accept requestID
    End Sub
    
    Private Sub sckTest_Close(Index As Integer)
        'Close and unload winsock    
        sckTest(Index).Close
        Unload sckTest(Index)
    End Sub

    ------------------

    Vincent van den Braken
    EMail: [email protected]
    ICQ: 15440110
    Homepage: http://www.azzmodan.demon.nl





    [This message has been edited by Azzmodan (edited 12-07-1999).]

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Melbourne, Victoria, Australia
    Posts
    126

    Post

    Guys and Gals...

    I got most of working...except for...

    For x = 1 To sckTest.UBound
    sckTest(x).SendData "message"
    Next x

    When that code is executed, it works fine but the terminals connected do NOT recieve "message"

    When I change the code to....

    Msgbox sckTest.UBound
    For x = 1 To sckTest.UBound
    sckTest(x).SendData "message"
    Next x

    It works like a dream, what on earth is going on?


    ------------------
    Regards,

    Paul Rivoli
    -------------------
    [email protected]
    http://users.bigpond.com/privoli

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Melbourne, Victoria, Australia
    Posts
    126

    Post

    I found my problem why its happening...

    BUG: Winsock Control SendData Only Works Over the Latest Connection

    _____

    The information in this article applies to:


    * Microsoft Visual Basic Professional and Enterprise Editions, 32-bit
    only, for Windows, versions 5.0, 6.0

    _____

    SYMPTOMS


    For a 32-bit Visual Basic application with multiple Winsock Control objects
    that maintain TCP connections to other socket applications, SendData() only
    works over the most recently established connection. This behavior is
    reproducible on versions prior to and include Microsoft Visual Studio SP3.

    CAUSE


    The event messages associated with each SendData() are flushed from the
    message queue by the latest socket connection. This causes data to queue up
    and with no event messages available to start the data send process for
    previous connections.

    STATUS


    Microsoft has confirmed this to be a bug in the Microsoft products listed at
    the beginning of this article.

    Please contact Microsoft Technical Support if you need to know the current
    status of this bug.

    For more information about eligibility for no-charge technical support, see
    the following article in the Microsoft Knowledge Base:


    Q154871 <http://support.microsoft.com/support/kb/articles/Q154/8/71.ASP>
    Determining If You Are Eligible for No-Charge Technical Support

    MORE INFORMATION


    To reproduce the problem assuming an application maintains an array of three
    Winsock Control objects, each of controls has established a connection with
    its peer side over TCP. Label the connections as C1, C2, and C3 based on the
    order the connections are established, with C3 as the most recently
    established connection. If you attempt to do the following:

    Private Sub cmdSendData_Click()

    Dim i As Long<BR/><BR/>

    For i = 1 To iIndex<BR/>

    If (socks(i).State = sckConnected) Then

    socks(i).SendData txtSendData.Text

    End If

    Next i

    End Sub
    Only the peer side of C3 connection get the messages. If you disconnect C3,
    the peer side of C2, which becomes the most recent connection at the time,
    will start to receive messages intended for it.

    REFERENCES


    For additional information, please see the following article(s) in the
    Microsoft Knowledge Base:

    Q183987 <http://support.microsoft.com/support/kb/articles/Q183/9/87.ASP>
    PRB: SendData Method Generates Error 40006

    Additional query words:

    Keywords : kbnetwork kbCtrl kbSDKPlatform kbSDKWin32 kbVBp500
    kbVBp600 kbWinsock kbDSupport kbGrpNet

    Version : WINDOWS:5.0,6.0

    Platform : WINDOWS

    Issue type : kbbug


    Last Reviewed: December 1, 1999
    © 1999 <http://support.microsoft.com/support/misc/cpyright.asp> Microsoft
    Corporation. All rights reserved. Terms of Use.


    <http://support.microsoft.com/library/images/support/1ptrans.gif>

    Article ID: Q245159

    Last Reviewed:
    December 1, 1999

    Provided by Microsoft Product Support Services
    <http://www.microsoft.com/support/>


    ------------------
    Regards,

    Paul Rivoli
    -------------------
    [email protected]
    http://users.bigpond.com/privoli

  5. #5
    Guest

    Post

    I just loveeeeeee!!! Microsoft.



    ------------------

    Vincent van den Braken
    EMail: [email protected]
    ICQ: 15440110
    Homepage: http://www.azzmodan.demon.nl




Posting Permissions

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



Click Here to Expand Forum to Full Width