When I put the open, send, and close commands all under one button it does not seem to work. It opens the connect, waits a second, then closes it without any data being sent. I thought it might have been working too fast for the server to handle it, but I put a 3 second pause in there and it still didn't work.
Here is what I have now (working).
Private Sub connect_Click() Winsock1.RemoteHost = editIPs.ip1.Text Winsock1.RemotePort = 1007 Winsock1.Protocol = sckUDPProtocol Winsock1.connect End Sub Private Sub discon_Click() Winsock1.Close End Sub Private Sub senddata_Click() Dim commands 'commands = Replace(commandsBox.Text, vbCrLf, "&") commands = "dir&pause" 'for testing Winsock1.senddata commands End Sub
...and this is what I REALLY want...
Private Sub sendbutton_Click() Dim commands 'commands = Replace(commandsBox.Text, vbCrLf, "&") commands = "dir&pause" Winsock1.RemoteHost = editIPs.ip1.Text Winsock1.RemotePort = "1007" Winsock1.Protocol = sckUDPProtocol Winsock1.connect Winsock1.senddata commands Winsock1.Close End Sub
This must be something easy, something I just missed. And I know someone has come across this problem before. Any help/ideas is appreciated.
Edited by machiefacro, 22 June 2005 - 12:31 AM.