Hello brock,

I'm not sure I understeand what you try to do but:

> declared separately in the unit. When i tried to remove the RemoteSocket
> declaration from
> type
> TClient = class(TWSocketClient)
  <snip>
> and make it a global variable when sending local and remote data at the same

You cannot. RemoteSocket is owned by TClient. Each TClient has his own
remotesocket. If you make it global there can only be 1 of it.

>  for i:=0 to wSocketServer.ClientCount-1 do wSocketServer.Client
> [i].SendStr(data);

This will send data to all the clients of the server (the local ones).

>  if Assigned(RemoteSocket) then
> RemoteSocket.SendStr(data2);

RemoteSocket is owned by that particular client of the server. Here you
send data2 to that particular remote socket.

---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
http://www.mestdagh.biz

Monday, October 31, 2005, 04:34, brock williams wrote:

> hi i was looking through SocketSpy source code under "User Made" section of
> ICS website and when i tested program i was curious about something. If i
> would like to send data (packets) to both the remote connection and local
> connection how would i do so?
>  A TWSocketServer component exist on the form but it spawns the client
> declared separately in the unit. When i tried to remove the RemoteSocket
> declaration from
> type
> TClient = class(TWSocketClient)
> private
> Rcvd: string;
> Color: TColor;
> public
>  RemoteSocket: TWsocket;
> Destructor Destroy; override;
> end;
> and make it a global variable when sending local and remote data at the same
> time i was not able to do so, only 1 at a time.What i'm asking is, how can I
> send data (e.g) under a button click event instead of having to send data
> only in the OnClientDataAvailable event etc.. I need to use both server and
> client sockets at literally the same time, one line under the other using
> SendStr(). I tried something like this but Remote connection took priority
> over local in sending.
>  for i:=0 to wSocketServer.ClientCount-1 do wSocketServer.Client
> [i].SendStr(data);
>  if (Assigned(RemoteSocket)) and (RemoteSocket <> nil) then
> RemoteSocket.SendStr(data2);
>  Any help would be greatly appreciated.
> --ICSNewbie05

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to