In java it is possible to create a socket server and a socket client, is it possible to have an instance of the socket server running and a socket/server client that is receiving data from the socket server on the same machine?
e.g the socket server runs on port 60010
and the socket client is running on the same machine connecting to that port through a socket or will I need to by a new machine and add it to my network? If it has a unique IP Address and port number running on the TCP/IP layer.
Here’s a simple runnable example to get you started. It starts two threads, one with a
ServerSocketand one which makes aSocketconnection. One continuously sends strings and the other prints them.You should simply be able to run this class as-is.