Solved

Simple TServerSocket question

Posted on 2001-06-15
1
154 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
1 Comment
 
LVL 5

Accepted Solution

by:
TheNeil earned 25 total points
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 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

6 Experts available now in Live!

Get 1:1 Help Now