Client/Server application with Indy

Hi experts,

How can i send strings and files using the Indy TCPServer and TCPClient components.

Thanks.
LVL 2
StTwisterAsked:
Who is Participating?
 
shaneholmesCommented:
If you interested, I have an example of using TServerSocket & TClientSocket

http://www.geocities.com/ielite_ielite/projects/multiplay.zip

just uncomment the sendText & receiveText lines (code is set to send bitmaps now).

Shane
0
 
StTwisterAuthor Commented:
When i open your form i get a invalid stream format error. Also i am missing variants.dcu and ScktComp.dcu. Do you know where can i get them from?
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
shaneholmesCommented:
What version of delphi are you using, this project was created in delphi 7.

Shane
0
 
StTwisterAuthor Commented:
i am using delphi 4
0
 
shaneholmesCommented:
ahhhhhhhh, thats why, you will  have to look in your help for TClientSocket or TServerSocket then look at what unit it they use (assuming of course, these exist in Delphi 4 - I can't remember, but im sure they did)

Anyway, regardless, If you can't get it to compile in delphi 4, I recommend the following:


Create a new application, add the two components (TClientSocket, TServerSocket), change the properties to reflect what i add in my code at runtime, then look at all my events I add at runtime, cut and paste the code from ,my events into your components events.

WHen you drop a TClientSocket on your form, hte appropriate unit will be added for you!


Shane
0
 
shaneholmesCommented:
STTwister,
 You may want to increase your points in the future for questions of this amplitude, otherwise you wont get many experts to bite - as you can tell, not many are jumping to answer your question. If you would have had a greater number of points, i guarantee, others would have given you code for the Indy components as well

Just a suggestion:

Shane
0
 
StTwisterAuthor Commented:
the problem is that i don't have TClientSocket and TServerSocket components. I have Delphi 4 Standard Edition, which doesn't got the internet pallete. That's why i'm using the indy package.

Thanks.
0
 
shaneholmesCommented:
ahhhhh, yup thats a problem

K, let me see what i can come up with for you

Shane
0
 
StTwisterAuthor Commented:
Ok, i changed my mind, i want to use TSimpleTCPServer and TSimpleTCPClient ( u can get them from http://swiss.torry.net/sockets.htm ).

To send strings, u use TSimpleTCPClient.Send(Buff,  BuffLength), but how can i send files?

Note that i increased the points to 50.

Thanks.
0
 
StTwisterAuthor Commented:
I found the answer myself. Can someone please close the question and refund the points???

Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.