Winsock problem 
Author Message
 Winsock problem

I am developing a system which involves 2 applications in a client-server environment. Let's call them AppA and AppB. AppA is the main beast, and may have multiple concurrent instances running on different machines across a LAN. Certain events must be notified to other instances, so I'm using a protocol across Winsock controls to do this. Now this is where AppB comes in. I need a 'Server' (poor choice of term perhaps) to coordinate the communications across Winsocks on instances of AppA. So AppB maintains an array of Winsocks, adding to it as necessary when an instance of AppA is started, and 'logs on' by sending .Connect through its own Winsock as follows...

    With Winsock1
        .RemoteHost = ""
        .RemotePort = 1007
    End With

AppB 'hears' this with

Private Sub Socket_ConnectionRequest(Index As Integer, ByVal requestID As Long)

    If Not mbOperatorLogonLocked Then

        mbOperatorLogonLocked = True
        mnSockets = mnSockets + 1

        Load Socket(mnSockets)
        With Socket(mnSockets)
            .LocalPort = 1007
            .Accept requestID
        End With

        Set mtmpWorkstation = New clsWorkstation
        Set mtmpWorkstation.Socket = Socket(mnSockets)

    End If

End Sub

Now that's all very well, but if there is an instance of AppA running on the same machine which is hosting AppB, it can't connect. Something to do with

How should AppA recognise that it is running on the machine which is hosting AppB, and then what is the correct .RemoteHost value for its Winsock?

Thanks if you can answer this for me.

Andy Ellis

Sun, 31 Oct 2004 19:05:32 GMT  
 [ 1 post ] 

 Relevant Pages 

1. winsock problem sending large strings (winsock.senddata)

2. Winsock Problem

3. .NET Socket vs VB6 Winsock problem!

4. winsock problems

5. Simple WINSOCK Problem

6. Simple Winsock Problem

7. Winsock Problems

8. VB5: winsock problem

9. Visual Basic 6 Winsock Problem

10. Winsock Problem

11. VB6 Winsock Problem

12. Winsock Problem


Powered by phpBB® Forum Software