Results 1 to 11 of 11

Thread: More Data Help

Threaded View

  1. #1

    Thread Starter
    Frenzied Member Inuyasha1782's Avatar
    Join Date
    May 2005
    Location
    California, USA
    Posts
    1,035

    More Data Help

    Ok this is client - server based using Winsock. Here is what I have.

    This is the client sending the data to server:

    VB Code:
    1. Private Sub Command5_Click()
    2. Dim msgee As String
    3. msgee = "GI"
    4. Winsock2.SendData msgee
    5.  
    6. Exit Sub
    7. End Sub

    This is the Server Receiving the data:

    VB Code:
    1. Private Sub winsock1_DataArrival _
    2. (ByVal bytesTotal As Long)
    3. Dim strData As String
    4. Winsock1.GetData strData
    5.  
    6.     If strData = "GI" Then
    7.     Dim info As String
    8.     info = "Test"
    9.     Winsock1.SendData info
    10.     Exit Sub
    11.     End If
    12.    
    13. End Sub

    This is the client receiving the data from the server:

    VB Code:
    1. Private Sub winsock1_DataArrival _
    2. (ByVal bytesTotal As Long)
    3. Dim strData As String
    4. Winsock1.GetData strData
    5. Text1.Text = strData
    6.  
    7. End Sub

    Well it looks good except it is not working. When I click the command button in the first code, it shoud send the data to the server. Then the server will recieve the data and check if it is "GI". If it is then, it will create a variable with the text "Test" in it, and send it back to the client. Then whatever the client recieves back from the server will be placed in text1.text. Except nothing appears. I have gone through about 3 times and can't figure out whats wrong. Probably something simple, but im not sure. Can anyone help?
    Last edited by Inuyasha1782; Jun 3rd, 2005 at 05:47 PM.
    Age - 15 ::: Level - Advanced
    If you find my post useful please ::Rate It::


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