Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

TServerSocket - file via sendbuf or Text via sendtext ?

Posted on 2016-10-11
1
Medium Priority
?
123 Views
Last Modified: 2016-10-12
How will TServerSocket's OnRead recognize if TClientSocket  has send file via sendbuf or Text via sendtext ?
0
Comment
Question by:Allan_Fernandes
[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
1 Comment
 
LVL 28

Accepted Solution

by:
Sinisa Vuk earned 2000 total points
ID: 41839082
There is no internal logic... You should use own logic. All what is send through tcp/sockets is a bunch of bytes...So, on each "packet" you send - set first byte to something (ex. $01 + length of data) what will represent common text, otherwise set o something else (ex. $02 + length of data) before you send file data. On server side revers logic. Read first byte and second few bytes for length of data. After that read exact amount of data (keep reading more blocks if whole length is not read)
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

618 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