Java Network Discovery - java

I'm running a Java application on my PC which involves migration of virtual machines running on my physical machine.
How can I connect to other physical machines on my network so that I can
1. Get info eg virtual machines running on them, emulator used etc. without the application being run on the client machine.
2. The network discovery must be automatic i.e. as soon as any PC is connected to the network, my machine should come up with all possible details of the PC.
3. I don't intend pinging all the computers on the network. I don't want any application run on the client machine. My machine should do the network discovery and info gathering by itself.
Could someone pls help me?
Thanks.

For 2 you should consider using Zeroconf as Apple do. For Java choose http://jmdns.sourceforge.net/

I've figured out a way to do the first part. This is how its done- 1. Open a connection to the qemu hypervisor on the destination physical machine through ssh. 2. use the same connect variable and Libvirt's functions to get the details about the other virtual machines running on the physical machine.

Related

Can a Java program access a specific port on a Guacamole connection?

Can I use the Apache Guacamole API to allow a Java program to access a specific port on a Guacamole server's connection? When I say connection, I mean a machine that the Guacamole server is connected to - a machine that would show up in the Guacamole web interface.
Background:
I set up an Ubuntu virtual machine as a local Guacamole server/client. The virtual machine also runs a series of centOS (LXD) containers, each with a respective IP address. Outside of the virtual machine, on the host machine on the same network, I am able to access the Guacamole web interface via a web browser and SSH into the centOS containers just fine.
Let's say I have a Java program on my host machine that needs to communicate with one of those centOS containers. Is it possible to use the Guacamole API to allow the Java program on the host machine to programmatically access a specific port on one of the Guacamole connections/centOS containers?
If so, how would I go about doing that? I'd appreciate any specific examples or documentation related to this. If there's a better way to go about this, please let me know.
Thanks.

How to host a java application (without using webservices)

I made a game with sockets that works fine on my machine, and now I would like to run the server on a host so that anyone can join in at any time.
All I'm finding are services for web applications, mine is just a swing application that can run by itself.
What kind of server can I use (instead of my own machine)? Would I need to change the code or is it possible to just find a host that runs my server application as is?
Also, note that for now I kept it simple, there is no data storage.
Take a look at Amazon EC2 cloud. Essentially what you're looking to do is acquire a public IP address (an be done from the Amazon EC2 admin console). You'll be installing java and then opening a port in your security settings to allow traffic to whatever port your game server is running on.
EC2 is free for low volumes of usage for the first year (new accounts only) and I've had fairly good luck with them in terms of downtime and affordability.

Connecting to remote virtual machine using sockets

I am trying to connect to a virtual machine using sockets in Java. I have my client and server applications working with no issues on localhost. When I run the Server code and try to connect from a separate machine with the IP address and port number, my client connection times out.
Here is a link to my virtual machine network settings page https://wiki.redbrick.dcu.ie/mw/RBVM_Networking
Do I need to specify any particular parameters in Java to make my server accept connections? Is this an issue I have to take up with the VM network admins?
Any suggestions would be appreciated !
p.s I am running ubuntu server and can access phpmyadmin remotely with no problems.
Edit
I have run nmap and the port I am using for the server side application shows up as open.
My provider was blocking all but a select few ports, got a list of open ones and now it works. derp!

Java application on Windows system running as USB peripheral

Is there a way to have a USB device act as a Host and an application on a Windows based system to act as the Peripheral? We have a USB device that is the host and we need it to connect to our application running on a Windows based system. The device is using USB 2.0 On-the-go specification, but it needs to run in Host role. We have found a few libraries and what not but they seem to only work if the application is host and the device is the peripheral. Any information or leads would be greatly appreciated.
Thanks.
The USB Ports on a typical Windows PC can only talk in Host mode. This means that if your device is directly connected to a PC (including hubs), it has to run in device mode.
There are devices that can talk to 2 USB hosts at one (e.g. some USB<->USB PC connection cables). That could be one solution to your problem, but to me it looks more like you just have to adapt your devices software some bits.

Java network communication problem

I have a problem that I think might be a java related one.
I have a java application I need to emulate multiple hosts.
The server/client work fine between "normal" computers.
When I use the emulator, I get connection refused when client tries to connect to a server in the emulator, same thing if I try telnet.
If I turn it around, the client cannot connect to the external server, but if I telnet from the external server, I get a connection.
This makes me think it is a java related problem.
Anybody gone through this problem before? This is for research purposes, so turning off java security only for this situation is no problem.
Thanks!
When you say emulator, I think you are talking about a virtual machine. Connecting from the real world into a virtual machine is not something that works automatically. The virtual machine can initiate connections out because the virtualization software handles that. Going the other way - what machine name do you use. How you configure your physical machine to routce packets to the ip address of your virtual machine (which your virtualization software made up). You may need a proxy on your physical machine to route the packets into the virtual one.

Categories

Resources