Guys,

Looks like nothing is possible to do in the simple and basic ways with ICS??

I was just thinking that I have understood a bit of the components today and now you guys are making it lot more complicated for me.

All I need is,
A server who accepts the clients and tells me which clients are online, can send once a while a simple command such as: "reboot" or send a file such as: "setup.exe" A client who accepts the command: "reboot" from the server and does the asked, receives the file "setup.exe" and does the asked.
The server will have maximum of 200 clients nothing more.

Sounds simple?
I can do this in 2 hours with "TCUSTOMSOCKET" of Delphi and protect it with SSH tunnel.
Why don't I?
Simple: because I want to do it with SSL in order to be able to have the better security, to have it in whole one piece and that is also the reason why I am not interested of doing it with the regular components because I can't secure them, because I don't have the knowledge of securing them.

Now,
Could you please answer,
can this be done with ICS or not?
if yes,
can you help me with the following procedure?
-------------------------------------------------------------
{This procedure sends the command to the clients and it works very nicely.}
procedure TSimpleSslServerForm.SendCommand;
begin
SslWSocketServer1.Client[0].SendStr(ledSendCommand.Text); /// The PROBLEM here is: How do I send the command to a specific client if I have more than one client?
 Display('Command sent: ' + ledSendCommand.Text);
end;
--------------------------------------------------------------------------------------------------------------------------------------------------

Thanks in advance

-daniel


-----Original Message----- From: Francois PIETTE
Sent: Monday, January 17, 2011 3:55 PM
To: ICS support mailing
Subject: Re: [twsocket] SslWSocketServer & SslWSocket

But, are you sure you don't want to revert the client/server roles ?
It would be much simpler for you.

I am sorry but I don't understand what you mean with this, Windows server/client rules or component?
Do you think I need both in both sides?

Here is how I see your problem solved:
First let agree on terminology. I need 4 names: master, remote, client and
server.
I will name "remote computer" or simply "remote" the group of computers you
currently name "client". I will name "master computer" or simply "master"
the computer you actually name "server".
I will name "server socket" or simply "server" a socket which passively wait
(listen) for incomming connections.
I will name "client socket" or simply "client" a socket which will do
whatever is needed to establish a connection.

Here are a few consequences:
Client socket will connect to server socket.
A socket server may have a lot of client connected.
Remote computer can have either or both client and server socket.
Master computer can have either or both client and server socket.

Here is how the whole application, distributed between remote (several) and
master (only one) comoputer would operate.
The master computer shall have a single server socket waiting (listening)
for remote computer connections.
A remote computer (there are a lot of them) shall connect to the master
computer using a client socket.
A remote computer shall send commands to the master. Basically there are two
commands: subscribe and unsubscribe.
Master computer receiving the subscribe command will add the remote computer
in a list of remote computers participating in the work. Wehn receiving the
unsubscribe command, the master computer will remove a remote computer from
the list.
The master computer, having the list of all participating remote computers
will be able to send commands to each remote computer. To do so, the master
computer shall use a client socket to connect to the server socket listening
at remote computer side. Obviously, each remote computer has a server socket
waiting for connections and commands from the master they subscribed. That
socket is programmed to accept only connections from the master after
subscriuption take place.
Remote computer receiving commands from master computer will execute the
command and return result back to the master computer.

This is a general picture of your software as I see it. Many details remains
to be fixed but you get the general ideas.
Other solutions are obviously possible, including using server socket only
at master side.

I can develop a specific set of demo programs for you, but not for free.
Contact me by email if you want an offer.

Regards,
--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be


----- Original Message ----- From: "daniel cc" <dan...@signedsource.com>
To: "ICS support mailing" <twsocket@elists.org>
Sent: Monday, January 17, 2011 11:03 AM
Subject: Re: [twsocket] SslWSocketServer & SslWSocket


and it doesn't work
Please be more specific. What error/exception do you have ?

You have not answered this one.

Most of the errors were --> Socket not connected.


Speaking about code, you select it by its index in the Client[] property.
How you find the right index is YOUR application problem. Tell me in english how you would like to select one client among all the connected clients and
I will help you translate this specification to code.

Here is what need to do,
When the client is connected,
It informs it's IP and connection port to the server as this: Client connected. Remote: 127.0.0.1/51665 Local: 127.0.0.1/443 I need to be able to use this information or ar least some of this information to send some commands this client.

But, are you sure you don't want to revert the client/server roles ?
It would be much simpler for you.

I am sorry but I don't understand what you mean with this, Windows server/client rules or component?

If the side you name "server" has to send "commands" to the side you name
"client" for execution and get back results, then what you name "server" is
actually a socket client and what you name "client" is actually a socket
server.

To say it otherwise: There is no problem having the computer you name
"server" to be an actual client - as far as socket programming is
concerned - for the computer you name as "client" which is turn would be a
server as far as socket programming is concerned.

You may also have both client and server socket at both side. By the way,
this is how FTP is working: the FTP client connect to the FTP server to send
commands (file transfert, dir list,...) to be executed by the server. When
the FTP server has to transfert a file, the (FTP) server become a (socket)
client connecting to a (server) socket located at the (FTP) client ! This
could be a scheme you could use to design your application.

Do you think I need both in both sides?
If yes,
Is it going to make any easier for me?
I need to start with sending commands but I need to send and receive files also in feature.



SslWSocketServer1.(Sender).Send(MyBufAddr, MyBufLnegth); --> need to be able to send the command which is typed in the "TEdit" field and I have no idea about how this works, so far I don't even know how to handle --> (MyBufAddr, MyBufLnegth); either.

Excuse me, don't take it worng, but I'm wondering if you know Delphi
programming or not :-(
You can see in the component source code and in the samples that Send method takes two arguments, the first is a pointer to what you want to send and the second is the number of bytes to send. You have a lot of ways to use that in
your software ! If you only have text to send, probably SendStr() method
will be easier for you: it take a single string type argument. Look at the
implementation to learn how SendStr() call Send()...

Sorry again for not being able to explain clearly,
There is,
.Send
.SendSTR
.SendLine

My problem is,
What is the right way and how can I get the result I need?

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

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

Reply via email to