VedhaR
VedhaR

Reputation: 507

Server without Clients listening to a port java

I am looking for a way to have a basic Java Server listen to a port without having any clients connected. Essentially, I need to be listening on this port for any data, then output it on the server side to see that it actually works. As there are multiple ways to implement Java App servers, I am not sure which would be the best.

Current thought flow: A client is able to connect to a server socket because the server is listening for a connection. Can it be so that it can be changed to listen to data? Instead of a client socket connection?

Code can be provided if needed but I just used a basic server example found online (using sockets).

Upvotes: 0

Views: 95

Answers (1)

VDanyliuk
VDanyliuk

Reputation: 1049

Before you start receiving data You have to establish connection between server and client sockets.

Upvotes: 1

Related Questions