Solved

Indy Socket data transfer

Posted on 2008-10-20
5
1,322 Views
Last Modified: 2013-11-17
I have a IdTcpServer and an IdTcpCLient correttly connected.. Now.. How do I send data from client to server and back to client? How do I trasfer a BYTE array, or a string? Thank you
0
Comment
Question by:ziggie301
  • 3
  • 2
5 Comments
 
LVL 16

Accepted Solution

by:
George Tokas earned 500 total points
ID: 22756397
You have to use Readxxx and Writexxx methods of the components...
Check out online help...

I'm not using Indy because they are using blocking socket configuration...
Instead I'm using the standard TServer/TClient sockets for the job...

In that case in example to send a string:
Server Side:
ServerSocket->Socket->Connections[x]->SendText("123");
For server socket we have to define the connection to send that identify the communication to the other end...

Client Side:
ClientSocket->Socket->SendText("123");

In this case there is only one socket connected and we don't have the Connected array...

To read what is sended:
Create a OnRead event handler (Double click OnRead on object manager) and inside add:

AnsiString S;
S = Socket->ReceiveText();

That is almost all...

George Tokas.
0
 

Author Comment

by:ziggie301
ID: 22811143
Sorry for my delay. I did'nt find any online help explaining how to transfer data after socket connection with indy sockets. that's why I was looking for some info about it. Does anyone know how to send data with Indy Sockets?
0
 
LVL 16

Expert Comment

by:George Tokas
ID: 22811693
BCB6 instal dir \Examples\Indy
17 subdirectories with examples...

George Tokas.
0
 

Author Comment

by:ziggie301
ID: 22856446
Sorry but I cannot find any subdirectory with indy examples.. I'm usingi Borland c++ Builder with Rad Studio 2007
0
 

Author Closing Comment

by:ziggie301
ID: 31507760
I'm sorry. I was in a hurry, very nervous and mostly unprepared. This answer is excellent. Thank you
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

Title # Comments Views Activity
How to access different segment using subnet mask 9 87
Port Generator Tool 10 91
Isolating a VM 1 79
CKEditor - will not function 7 62
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
Network ports are the threads that hold network communication together. They are an essential part of networking that can be easily ignore or misunderstood, my goals is to show those who don't have a strong network foundation how network ports opera…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

910 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

21 Experts available now in Live!

Get 1:1 Help Now