Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Sep : Listen to network broadcasts?
| Subject: | Listen to network broadcasts? |
| Posted by: | "John Friel" (jo..@frieltek.com) |
| Date: | Thu, 21 Sep 2006 11:06:51 |
I am writing this application that uses a SQL Server database that does IC,
AP, AR etc for a warehouse distributor. It is very "real time" in all
operations compared to the old terminal + Unix that looked like DOS 15 years
ago.
The entire application is written such that all dialog boxes are modeless
and the exchange of broadcast messages inside the application let the other
dialogs know if something has changed. This cuts down on needless timers
constantly querying the SQL server just to update a grid, for example.
This is all well and good and works just as it should.
Now, expand this application to multiple workstations on the network. What
I would like to do is "broadcast" these internal messages to the network
(the broadcast IP?) and have my program also listen for this broadcast so I
know when to make new queries to the SQL server.
The data packet would simply be the WM_MessageID that I am sending to the
internal dialog boxes via
with a call like this:
BroadcastToAll(WM_ReloadReceivedPOs, 0, 0, self.handle);
and the procedure looks like this:
Procedure BroadcastToAll( msg: cardinal; param1, param2: Longint; ignoreWnd:
HWND );
var
I: Integer;
wnd: HWND;
begin
//
// tell all the open dialog boxes about this msg
//
for i:= 0 to Screen.FormCount-1 do
if Screen.Forms[I].HandleAllocated then
begin
wnd:= Screen.Forms[I].Handle;
if wnd <> ignoreWnd then
PostMessage(wnd, msg, param1, param2);
end;
//
// now broadcast this msg to the network
// ???
//
end;
I'm using D2006 Professional with the Indy components but just don't know
what or how that second broadcast would be handled.
Thanks in advance!
John