Results 1 to 3 of 3

Thread: Winsock echo and reverse

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2007
    Posts
    10

    Winsock echo and reverse

    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:
    Code:
    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

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Winsock echo and reverse

    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?
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2007
    Posts
    10

    Re: Winsock echo and reverse

    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

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