DUUUDE, this is awesome! Note to others: You have to create the server form before you can connect the client (he shows you how to do the client first, then the server)
Agreed, and also the TclientSocket / TServerSocket components are old and deprecated mainly used for legacy applications today.... but they are still very useful. I do however recommend using newer Socket libraries for more stable and more manageable networked based applications... example (INDY, Synapse, ICS by Overbyte, Clever Internet Suite ect... ect..), and for those of you who wish to keep your file size down I recommend going all out and using raw Winsock API calls... unless of course your programming a Multi device application which will be cross compiled to run on many different Operating Systems.
It doesn't work if client runs in a different computer at a different internet connection. Could please test as I did to see if it works and upload the solution. I though Client host or IP is the problem. Thank you !
This code have a problem with connection and Is no worked! Error message to connect is socket error 10061 (In C++ simple apps on Help file RAD Studio "Creating the Web Interface (InterBase Tutorial) " for Client apps have a wrong code - line - ClientDataSet1->RemoteServer = UserSession->DSProviderConnection1; In same tutorial for Delphi code have not problem! )
It seems that you did not configure server properly, as you can see in this video this is working. As for error message that you are getting see this on google : www.google.com/search?source=hp&ei=N4hvWr3WEcSosgHu2YLgDA&q=socket+error+10061+&oq=socket+error+10061+&gs_l=psy-ab.3..0l10.1544.1544.0.6950.3.2.0.0.0.0.323.323.3-1.2.0..1..0...1c.2.64.psy-ab..1.2.575.6..35i39k1.252.2Q5hGEDE0To
well if your using the old Socket components which the guy used in this video .... The "TclientSocket" & "TserverSocket" VCL components the task your trying to accomplish is actually VERY VERY easy do not over think it ok... Every client connection that comes in is stored in the TserverSockets "Connections List" which gives you a default way of locking onto the client or "Clients" you are wanting to send commands or messages to from the server itself, However using the serversockets connection list alone is not a good idea..... The most simplified way of sending data to a particular client from the server socket is to use the following line of code: self.ServerSocket1.Socket.Connections[0].SendText('yo this is some data'); See the 0 in the line of code that means your sending to the first client that connected to the server so if you wanted to send to the second client you would just take that integer up by one at a time until you are talking to the client that you want to speak to like this: self.ServerSocket1.Socket.Connections[0].SendText('yo this is some data'); self.ServerSocket1.Socket.Connections[1].SendText('yo this is some data'); self.ServerSocket1.Socket.Connections[2].SendText('yo this is some data'); Only problem with this is that its PRIMITIVE and NOT a very good way to keep up with active socket connections.... so what we can do to remedy this is to make our very own "Record variable" and store the TcustomWinsocks.data property into our record, this will make things much better for when we wish to communicate to any client in particular.... So instead of calling them by a Number which makes almost no sense we can start to develop our very own system of Naming each client and then simply looping through the active client socket connections until we find the specific person / client we are wanting to send data to. Go here: stackoverflow.com/questions/4849596/tserversocket-and-many-tclientsocket Look at the answer I provided, I hope it helps you out. Also Check here: stackoverflow.com/questions/38835189/delphi-how-to-send-text-to-one-specific-client-connected-to-the-server-socket Look at the answer provided by Remy Lebeau. Anyways I hope this stuff helps you out good luck with your future projects.
If you watched carefully you can see that first you have to activate server.exe giving it port to listen to and click activate. Then open client.exe , enter IP address(for example enter loacl IP : 127.0.0.1) and enter the same port as for server.exe and click "connect". In server app you should see IP , client host name and information that it is connected.
If google translate translated this good, thank you :-) Socket components can be installed from "bin" folder of Embarcadero RAD studio, for example if you use Embarcadero XE than you can find it in : " C:\ProgramFiles\Embarcadero\RAD Studio\8.0\Bin\" named something like "dclsockets230.bpl"(this one is from Embarcadero Seatle , see this link : docwiki.embarcadero.com/RADStudio/Seattle/en/Installing_Socket_Components)
DUUUDE, this is awesome! Note to others: You have to create the server form before you can connect the client (he shows you how to do the client first, then the server)
Agreed, and also the TclientSocket / TServerSocket components are old and deprecated mainly used for legacy applications today.... but they are still very useful. I do however recommend using newer Socket libraries for more stable and more manageable networked based applications... example (INDY, Synapse, ICS by Overbyte, Clever Internet Suite ect... ect..), and for those of you who wish to keep your file size down I recommend going all out and using raw Winsock API calls... unless of course your programming a Multi device application which will be cross compiled to run on many different Operating Systems.
This was "superb". Hope you haven't stopped.
@Duke Jeremias : Thanks.
Reminds me of a "PaperX" the infamous tutorial on how to code a RAT or Trojan
Excelente aplicacion... sigan asi saludos.
It doesn't work if client runs in a different computer at a different internet connection. Could please test as I did to see if it works and upload the solution. I though Client host or IP is the problem. Thank you !
Hi wy i can' connect with different machines or ip's
Hi Thank for the post.. but drive google not contains a source code only exe.. you can post it again?
I am working on a delphide web service.
I'm new to delphi.
I couldn't find much on the internet.
Is there a site you can recommend?
Ty bro nive work
This code have a problem with connection and Is no worked!
Error message to connect is socket error 10061
(In C++ simple apps on Help file RAD Studio "Creating the Web Interface (InterBase Tutorial) " for Client apps have a wrong code - line - ClientDataSet1->RemoteServer = UserSession->DSProviderConnection1; In same tutorial for Delphi code have not problem! )
It seems that you did not configure server properly, as you can see in this video this is working.
As for error message that you are getting see this on google :
www.google.com/search?source=hp&ei=N4hvWr3WEcSosgHu2YLgDA&q=socket+error+10061+&oq=socket+error+10061+&gs_l=psy-ab.3..0l10.1544.1544.0.6950.3.2.0.0.0.0.323.323.3-1.2.0..1..0...1c.2.64.psy-ab..1.2.575.6..35i39k1.252.2Q5hGEDE0To
Same error tried mNy but couldn't resolve what to do?
to bad this doesn't work for delphi xe7. there is no ClientSocket in the components tab. was hopping to try this.
you have to add it from the file C:\Program Files (x86)\Embarcadero\Studio\XX.0\bin\dclsocketsXXX.bpl
@@radov3r Thanks dude, saved my day :)
a lot of thanks ...
very nice work, but when I try it cont see the message who sent from server to client, only this problem,,can you explain me ?
well if your using the old Socket components which the guy used in this video .... The "TclientSocket" & "TserverSocket" VCL components the task your trying to accomplish is actually VERY VERY easy do not over think it ok...
Every client connection that comes in is stored in the TserverSockets "Connections List" which gives you a default way of locking onto the client or "Clients" you are wanting to send commands or messages to from the server itself, However using the serversockets connection list alone is not a good idea.....
The most simplified way of sending data to a particular client from the server socket is to use the following line of code:
self.ServerSocket1.Socket.Connections[0].SendText('yo this is some data');
See the 0 in the line of code that means your sending to the first client that connected to the server so if you wanted to send to the second client you would just take that integer up by one at a time until you are talking to the client that you want to speak to like this:
self.ServerSocket1.Socket.Connections[0].SendText('yo this is some data');
self.ServerSocket1.Socket.Connections[1].SendText('yo this is some data');
self.ServerSocket1.Socket.Connections[2].SendText('yo this is some data');
Only problem with this is that its PRIMITIVE and NOT a very good way to keep up with active socket connections.... so what we can do to remedy this is to make our very own "Record variable" and store the TcustomWinsocks.data property into our record, this will make things much better for when we wish to communicate to any client in particular....
So instead of calling them by a Number which makes almost no sense we can start to develop our very own system of Naming each client and then simply looping through the active client socket connections until we find the specific person / client we are wanting to send data to.
Go here:
stackoverflow.com/questions/4849596/tserversocket-and-many-tclientsocket
Look at the answer I provided, I hope it helps you out.
Also Check here: stackoverflow.com/questions/38835189/delphi-how-to-send-text-to-one-specific-client-connected-to-the-server-socket
Look at the answer provided by Remy Lebeau.
Anyways I hope this stuff helps you out good luck with your future projects.
does it work with different machine??
thank you
Thanks bro
This is a TCP Client/Server application of course, right?
Yes, TCP/IP
thanks!
Thanks
How did you connect the client to the server ?
If you watched carefully you can see that first you have to activate server.exe giving it port to listen to and click activate.
Then open client.exe , enter IP address(for example enter loacl IP : 127.0.0.1) and enter the same port as for server.exe and click "connect".
In server app you should see IP , client host name and information that it is connected.
Thx i figured it out
Muito bom parabéns! onde posso baixar o Socket? poderia me indicar?
If google translate translated this good, thank you :-) Socket components can be installed from "bin" folder of Embarcadero RAD studio, for example if you use Embarcadero XE than you can find it in :
" C:\ProgramFiles\Embarcadero\RAD Studio\8.0\Bin\" named something like "dclsockets230.bpl"(this one is from Embarcadero Seatle , see this link : docwiki.embarcadero.com/RADStudio/Seattle/en/Installing_Socket_Components)
Harus menggunakan 2 computer ?
i am vb coding i see the delphi so easy and fast
هل استطيع السؤال بالعربية ارجوكم
"Can I ask you Arabic?" , Only over google translate -:)
Delphi practical school your facbook plz!!
There is no one yet, but will be soon.All let you know.
Delphi practical school How can i communicate with you
For now use mail: clearsoftx@gmail.com
Say something
Floppy