Solved

How to handke mutiple Winsock Clients messages?

Posted on 2008-10-11
2
235 Views
Last Modified: 2013-11-23
Hi Experts,
My Delphi 6 application need to listen to a TCP port and respond to multi clients messages accordingly.

This is the protocol of the communication.

Connection Request from client , 16 bytes
A B C L 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

I need to respond with 16 bytes
A B C R  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

Then Client will Send 16 + Commad No of Bytes which will be in 8 to 11
A B C L  0x00 0x00 0x00 0x00 8 9 10 11 0x00 0x00 0x00 0x00 ...

I need to respond this with same No of bytes
A B C R  0x00 0x00 0x00 0x00 8 9 10 11 0x00 0x00 0x00 0x00 ...

Finally  Disconnection from Client.
A B C L 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

I'm VERY new to winsock and TCP comunication. It would be very helpful if it is a detailed working sample.

When I use a Network Snipper WireShark the data for Connection looks is like this
41 42 43 4c 00 00 00 00 00 00 00 00 00 00 00 00

Thanks
PCSC
0
Comment
Question by:pcssecure
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Accepted Solution

by:
mikelittlewood earned 500 total points
ID: 22694206
Take a look at the indy components and demos at http://www.indyproject.org/index.en.aspx
0
 

Author Comment

by:pcssecure
ID: 22695904
I'm seeing something wrong in the format. So re-posting again.
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question