Solved

Client/Server application with Indy

Posted on 2004-04-26
11
519 Views
Last Modified: 2010-04-05
Hi experts,

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

Thanks.
0
Comment
Question by:StTwister
  • 6
  • 5
11 Comments
 
LVL 11

Expert Comment

by:shaneholmes
Comment Utility
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
 
LVL 2

Author Comment

by:StTwister
Comment Utility
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
 
LVL 11

Expert Comment

by:shaneholmes
Comment Utility
What version of delphi are you using, this project was created in delphi 7.

Shane
0
 
LVL 2

Author Comment

by:StTwister
Comment Utility
i am using delphi 4
0
 
LVL 11

Expert Comment

by:shaneholmes
Comment Utility
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 11

Expert Comment

by:shaneholmes
Comment Utility
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
 
LVL 2

Author Comment

by:StTwister
Comment Utility
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
 
LVL 11

Expert Comment

by:shaneholmes
Comment Utility
ahhhhh, yup thats a problem

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

Shane
0
 
LVL 11

Accepted Solution

by:
shaneholmes earned 50 total points
Comment Utility
0
 
LVL 2

Author Comment

by:StTwister
Comment Utility
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
 
LVL 2

Author Comment

by:StTwister
Comment Utility
I found the answer myself. Can someone please close the question and refund the points???

Thanks.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

772 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

10 Experts available now in Live!

Get 1:1 Help Now