I'm having a client server which the server read a text file line by line and send each line to the client upon client connection.
The problem I'm having is that on the client side the data is combined, meaning I get all lines that are on the file at once but what I want is to get each line just like how it is sent. This is the server side code I have.
Dim myFileName As String Dim myLine As String Dim FileNum As Long myFileName = "c:\myfile.txt" FileNum = FreeFile Close FileNum Open myFileName For Input As FileNum Do While Not EOF(FileNum) Line Input #FileNum, myLine Winsock1.SendData myLine ' MsgBox myLine Loop
For now the file only consist of 2 lines but the client display a message containing all the text file data in one message box but it should be displaying two messages.
Here is my client side DataArrival code:
Dim strData As String Winsock1.GetData strData, vbString MsgBox strData
I think I should use a
For Each strData but don't know how. Anyone who knows a better solution.