0
votes

iam trying to test my application to public network so i will use my own ip as server , i already did port forward in my router settings, " my goal is reach this application to computers out side my network " but i only can receive data i cannot send from my main ip to other computer ,, i have disabled my firewall also the other pc firewall is this problem of my router ? or my network ? i tried to disable router firewall but still same problem is there other things i have to check ? also i set my indtCP server binding to 0.0.0.0 to reach all network.

1
"I can only receive data, I cannot send from my server to clients", that's just how client/server architecture behaves (if that's the problem you're trying to resolve). Clients connect to your server and when they are connected, you can send them data. - TLama
Thank You for making me understand something . - DelphiStudent

1 Answers

1
votes

You should be able to send, but only after the client connects to your server.

When a client connects you should handle OnConnect event of your TIdTCPServer component. AThread parameter represent your client. You can respond to it by, for example:

AThread.Connection.Write ('Hi!');

You can disconnect the client by:

AThread.Connection.Disconnect;

Of course, many clients can be connected at the same time. In this case, you should keep track on all (dis)connected clients.