Solved

How to handke mutiple Winsock Clients messages?

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
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.

758 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

16 Experts available now in Live!

Get 1:1 Help Now