Results 1 to 2 of 2

Thread: WinSock Problem ?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2001
    Location
    Le Havre
    Posts
    66

    WinSock Problem ?

    I want to connect two or more client to a server.

    I try but it doesn't work .
    The server doesn't have the connection request for the other client
    Only the first client success to connect to the server

    On Load :
    iSockets = 0
    Server(iSockets).Protocol = 0
    Server(iSockets).LocalPort = Text1.Text
    Server(iSockets).Listen

    Private Sub Server_Close(Index As Integer)
    Server(Index).Close
    Unload Server(Index)
    iSockets = iSockets - 1
    End Sub

    Private Sub Server_ConnectionRequest(Index As Integer, ByVal requestID As Long)
    If Server(iSockets).State <> sckClosed Then Server(iSockets).Close
    If Index = 0 Then
    sRequestID = requestID
    iSockets = iSockets + 1
    Load Server(iSockets)
    Server(iSockets).Accept requestID
    End If
    StatusBar1.Panels(1).Text = "Connecter"
    End Sub

    Private Sub Server_DataArrival(Index As Integer, ByVal bytesTotal As Long)
    Dim Texte As String

    Server(Index).GetData Texte, vbString
    RichTextBox1.Text = RichTextBox1.Text + Texte + vbCrLf

    End Sub


    Help Me.
    Vix
    VB6 SP4
    NT4 SP6 & W2K Server SP1
    SQL Server 7 & 2000
    )--( )--( )--(

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Mar 2001
    Location
    Le Havre
    Posts
    66

    Resolved

    This is this line who create the problem :

    If Server(iSockets).State <> sckClosed Then Server(iSockets).Close

    This code close the connection just after the connection request so it could'nt work with

    Bye
    Vix
    VB6 SP4
    NT4 SP6 & W2K Server SP1
    SQL Server 7 & 2000
    )--( )--( )--(

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