How can I find all servers on the local network? [closed] - java

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to design a software in java. I have a client program in my personal computer which is located in a LAN. In other pcs of this LAN server application has been installed. So the image of my system is like this:
Ok, in this system servers have not same port , because some ports may close in each system, these servers just listen to a connection after finding an open port , as well Client doesn't know their IP, but as I mentioned all of these servers and client program are located in a LAN, picture of client program is some thing like this:
When I click the Scan NetWork Button , Client should find all of the listener servers in network , what should I do in this case? Is it possible to find all listener servers with a client in a network with cause I'm new to networking.

What you probably want is some kind of zero-configuration networking instead, like Bonjour/Zeroconf or SSDP. There are several Java implementations for both, as well as lots of native implementations on almost all OS.
They both solve your problem of finding the servers without knowing their IPs or ports.

Related

how do typical chatting application like yahoo messenger implement chatting with different users? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have gone through resources on building chat application using socket programming in java. In every implementation people try to make a server which runs in infinite loop, accepting the connections from client and creating a separate thread for handling the chat.
I want to make a chat application in which a new dialog/chat window pops when someone wants to chat with me (on client side). But the catch is that i have only one socket through which i am connected to server. all the messages has to be sent through this streams, currently i am thinking of some adhoc approaches for directing output to different client windows but i am sure that there must be some elegant way to do this.
If you want to use a single socket connection per client, then all communication should be multiplex over that connection, which means that you need to develop a protocol on top of socket streams between your server and a client. A protocol is a set of rules. For example, clients may issue commands and server respond to them, like one command, one response. The commands and responses need to be marked and separated somehow from each other, perhaps you want to add an identifier and a length of a message and then refer to that message.
Various systems use different protocols.

What is the most efficient and best way to implement a bidirectional communication system using Java? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
My problem is the following, I have two servers from which I have to transfer files, in both directions. The transfer is triggered by a file creation event (on respective sides). The problem is one server has a public IP, the other one doesn't.
I have implemented a socket client that sends a file over a socket, and a socket server which receives and saves it. (Working part)
My questions are : How to keep the socket 'alive' and send some data to the client after a file-system event occured on the server-side ? (Can the server call the client without knowing it's public IP ?)
Can I achieve this with socket technology or should I go for something else like RMI ?
The problem I see is not really an implementation issue. The problem is that you want to keep the client without a fixed address. If you had a fixed IP, I suppose there would be no problem. Right? As you probably understand there is no easy way for a computer to be called without having an address.
An option would be to use an middle solution, wrapping your non-fixed IP with a DNS able to refresh. You could use a service like dyndns to get a domain name which will actually redirect each packet to the real IP. Your router would have to be configured accordingly in order to refresh the IP to the dyndns servers each time it changes.
Another option, would be to use the websockets paradigm which now is part of HTML5. This way, the server would be able to push content to the client whenever he wanted it.
All of the above solutions depend heavily on your detailed scenario and I cannot by anyway guarantee that what I suggest is the best solution. Actually, I would strongly suggest to get a fixed IP which is a lot costless and cleaner solution than the ones I describe.
Hope I helped!

How to make android multiplayer games without port forwarding [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am trying to make a multi-client application in which somebody is the host and other people join into the game. I need this to be possible without port forwarding so that users can easily set up their server. Is this possible without any help from any of those server hosting companies that help out? Is there any special port that doesn't require port forwarding?
As far as I know, the only possible approach is to use UPnP (Universal Plug and Play). More specific: Internet Gateway Device Protocol (IGDP). This makes the port forwarding go automatically. It is a protocol that has the possibility to ask the gateway to forward a port to your machine. So this isn't really "without" port forwarding, but it will do it automatically, instead of the user having to go and configure their router.

Server management using PHP [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have a Java server application. I Also have a PHP page which displays logs related to the server, both the page and the server share the same database. I want to be able to stop/start the server (which starts from a .bat) through my page.
What is the best and most secure way to accomplish this?
I tried using some functions which are supposed to run files like exec and system but they just didn't work. I think it's because these are disabled on XAMPP.
Obs.: I can't kill the server process, it would left the ports in use.
The Java-based server should expose some kind of admin interface, for example a socket or a Web Service. When it receives a message (which meaning is "shutdown") it starts an orderly shutdown.
As a security measure, the admin interface should only listen on 127.0.0.1.

How to communicate between mobile with PC? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am developing a program that is used to communicate between a mobile and a pc. I don't have any idea how to start?
To do that you would need to write two separate pieces of software:
1) A Server
2) A Client
I would suggest you install the server on the PC and the client on the phone.
The client would establish a TCP connection to the server and would be able to send messages reliably. Upon receiving the messages from the client (phone) your server (pc) will act accordingly.
You can refer to the java documentation to find two simple samples about creating TCP servers and clients and these should be very helpful. Example Link
You can use the bluetooth of the mobile, and develop a Server in java for your pc.
I have done this process.

Categories

Resources