Results 1 to 4 of 4

Thread: [RESOLVED] Winsock Client/Server

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2008
    Posts
    207

    Resolved [RESOLVED] Winsock Client/Server

    I have a client side and server side application. I'm trying to get it so when I click a button the client side, it opens up a messagebox on the server side. I was thinking the code was something like this:

    Client Side:

    Code:
    Private Sub cmdConnect_Click()
    Winsock1.RemoteHost = "127.0.0.1"
    
    Winsock1.RemotePort = 6667
    
    Winsock1.Listen
    
    End Sub
    
    Private Sub cmdSendMsg_Click()
    Dim Data
    
    Data = "Open MessageBox"
    
    Winsock1.SendData (Data)
    
    End Sub

    Server Side:

    Code:
    Private Sub Form_Load()
    Winsock1.RemoteHost = "127.0.0.1"
    
    Winsock1.RemotePort = 6667
    
    Winsock1.Listen
    End Sub
    
    Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
    Dim Data
    
    Winsock1.GetData (Data)
    
    If InStr(Data, "Open MessageBox") Then
    MsgBox("Opened MessageBox!")
    End If
    
    End Sub
    But this doesn't work. Any ideas?
    Last edited by Blackbelt12; Jul 8th, 2009 at 10:42 PM.

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