PDA

Click to See Complete Forum and Search --> : Winsock echo and reverse


munzaa2007
Oct 29th, 2007, 02:57 PM
I am using winsock over tcp/ip based connection and I have successfully implemented a simple tcp-based client/server interaction. However, I would like to twist the implementation a little bit to for the server to send an echo of string from the client when one at the client end clicks cmdEcho or the server to send a reverse of the string when one at the client end clicks cmdReverse...Here is a bit of the code, if it can be of clarification:
Private Sub myTCPServer_DataArrival(ByVal bytesTotal As Long)
'Read incoming data into the str variable
'then send it back to client as an echo and a reversed string
Dim message As String
myTCPServer.GetData message
lblDisplayClientText.Caption = message
myTCPServer.SendData message
End Sub

Al42
Oct 29th, 2007, 05:24 PM
What do you need, how to reverse a string? How to tell the server which to do? How to have the server send text to the client?

munzaa2007
Oct 30th, 2007, 02:37 AM
If one clicks cmdEcho on the clientside, then the server should send back the same string for client to display on txtEcho

and if one clicks cmdReverse, the server should reverse the string it received from the client, reverse it then send to client for display on txtReversed

appreciated