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:
Private Sub Command3_Click() Winsock.SendData "OpenCD" End Sub Private Sub Command4_Click() Winsock.SendData "CloseCD" End Sub
server:-
VB Code:
Private Sub Winsock_DataArrival(ByVal bytesTotal As Long) Dim strData As String Winsock.GetData strData If strData = "OpenCD" Then OpenCD End If End sub Sub OpenCD() mciSendString "set CDAudio door open", 0, 127, 0 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?




Reply With Quote