Solved

Simple TServerSocket question

Posted on 2001-06-15
1
159 Views
Last Modified: 2010-04-06
I'm wondering how I would go about sending text to all connected clients from a TServerSocket. Normally I use Socket.SendText to send to one I just recieved text from, but that only sends to a specific sock, I wanna send to ALL connected sockets... Any takers?
0
Comment
Question by:Psylord
[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 5

Accepted Solution

by:
TheNeil earned 25 total points
ID: 6194394
Try iterating through all of your connections:

VAR
  iCount : LONGINT;
begin
  FOR iCount := 0 TO (ServerSocket1.Socket.ActiveConnections - 1)
  DO
    ServerSocket1.Socket.Connections[iCount].SendText(sMsg);
END;

The Neil =:)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

717 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