Solved

How to handke mutiple Winsock Clients messages?

Posted on 2008-10-11
2
229 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Navigation is an important part of web design from a usability perspective. But it is often a pain when it comes to a developer’s perspective. By navigation, it often means menuing. This is less theory and more practical of how to get a specific gro…
There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

864 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now