Hey,

I had this command working a few days ago. It's a really simple program. Thanks for the help!

This is my Server. The winsocks name is Winsock1 and it's index is 0.
VB Code:
  1. Private Sub cmdSend_Click()
  2.    
  3.     Winsock1(0).SendData txtChat.Text
  4.     DoEvents
  5.  
  6.     'txtMain.Text = txtMain.Text & vbCrLf & txtChat.Text
  7.     txtChat.Text = ""
  8. End Sub


My client should recieve like this
VB Code:
  1. Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
  2. Dim strData As String
  3.     Let txtMain.Text = ""
  4.  
  5.     Winsock1.GetData strData
btw, thats not the whole client script, it is a bit of it. The client uses a winsock with the name of Winsock1

Ehh I'll just put the whole server code here, nothing private in it :P
VB Code:
  1. Option Explicit
  2.  
  3.  
  4.  
  5. Private Sub cmdSend_Click()
  6.    
  7.     Winsock1(0).SendData txtChat.Text
  8.     DoEvents
  9.  
  10.     'txtMain.Text = txtMain.Text & vbCrLf & txtChat.Text
  11.     txtChat.Text = ""
  12. End Sub
  13.  
  14. Private Sub Command1_Click()
  15. data.Text = ""
  16. End Sub
  17.  
  18. Private Sub Command2_Click()
  19.     Load Form2
  20.     Form2.Show
  21. End Sub
  22.  
  23. Private Sub Form_Load()
  24.    
  25.     Winsock1(0).LocalPort = 10101  'In my example winsock1(0) is the listening winsock... others are use for two way communication..
  26.     Winsock1(0).Listen
  27. End Sub
  28.  
  29. Private Sub Winsock1_ConnectionRequest(Index As Integer, ByVal requestID As Long)
  30. Dim newIndex As Integer
  31. newIndex = Winsock1.Count     'We have to get another socket to communicate with incoming client...
  32. Load Winsock1(newIndex)  'Loading into the array
  33. Winsock1(newIndex).LocalPort = Winsock1(newIndex).LocalPort + 1   'Set new local port, i.e. 1 plus previous port
  34. Winsock1(newIndex).Accept requestID    'Now accept the request
  35. List1.AddItem Winsock1(newIndex).RemoteHostIP    'Adding to list to see the IP of incoming client..
  36.  
  37. End Sub
  38.  
  39. Private Sub Winsock1_DataArrival(Index As Integer, ByVal bytesTotal As Long)
  40. Dim strData As String
  41.     Winsock1(Index).GetData strData
  42.     data.Text = data.Text & strData
  43. End Sub

Anyone know what this little bug can be? I don't wanna change any of the code except the
VB Code:
  1. Winsock1(0).SendData txtChat.Text

That has got to go!

Thanks!