Results 1 to 13 of 13

Thread: Winsock help needed - AGAIN

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member gamezfreakuk's Avatar
    Join Date
    Mar 2002
    Location
    Nottingham, UK
    Posts
    302

    Winsock help needed - AGAIN

    Hello there.

    I'm having a little trouble on grasping some probably basic Winsock knowledge and I need your help.

    Ok i'm making a client/server application for my network. What it does is the client issues commands to the server (the other computer).

    But this is where a problem arises - I want to issue more then one command but i'm not sure on how to go about it.

    Heres the code I have (on the client)

    VB Code:
    1. Private Sub Command3_Click()
    2. Winsock.SendData "OpenCD"
    3. End Sub
    4.  
    5. Private Sub Command4_Click()
    6. Winsock.SendData "CloseCD"
    7. End Sub

    server:-

    VB Code:
    1. Private Sub Winsock_DataArrival(ByVal bytesTotal As Long)
    2. Dim strData As String
    3.  
    4.   Winsock.GetData strData
    5.  
    6. If strData = "OpenCD" Then
    7.  
    8. OpenCD
    9.  
    10. End If
    11. End sub
    12.  
    13. Sub OpenCD()
    14.  
    15. mciSendString "set CDAudio door open", 0, 127, 0
    16.  
    17. End Sub

    What I need to know is a way of letting the server recognise what command its received - In this case "OpenCD" or "CloseCD".

    How would I go about doing this? Surely not making new strings for each command?
    Last edited by gamezfreakuk; Sep 8th, 2003 at 08:27 AM.
    Gamezfreak
    Visual Basic 6 Enterprise Edition
    Borland C++ Builder 6 Enterprise Edition

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