Server app hosted on VPS hangs up - java

I'm developing a simple server-client app. Server application is hosted on a VPS. I have a problem with it: it behaves weirdly... When I test it on my PC it works fine, but when I launch it on VPS it (program) hangs up when a client app try to connect (the protocol is TCP). I can't even kill it with "killall -vs TERM java" command, so I need to reboot a whole VPS in order to restart it. Client and server apps are both written on Java. The VPS OS is Ubuntu. Can anyone give me a piece of advice of that matter please?

Actually, the problem was in the System.out.println("some_text") commands. My server didn't want to work without this commands in certain places. Why - I don't know yet. I'll do some researches conducted with that behaviour. But anyway, that's a subject for another question.

Related

How to execute remote COM dlls?

I am having a problem about running a COM dll remotely on windows PCs.
I have a COM dll registered in all the client stations (windows) of my network and a .NET application hosted on a server in my network.
There is a POST request, which will receive the client ip as a parameter and the application will execute a remote call to the dll installed on the pc of the ip passed in the request.
I already used PHP with XAMPP, I could verify that it works locally, although XAMPP reboots a few times (I still do not know the real reason). one solution would be to install locally on each client a network xampp server with a php application receiving requests and running the dll locally, but would be impractical in view of the amount of computers available on the network.
Still with PHP, I saw that it would be possible to remotely call this faq from the php documentation, but to no avail. I'm starting .NET with C # because I believe being native (windows) will be better/easier to get results, but I have not yet found a plausible solution to run the dll remotely.
As a result, I will have the opening of the COM dll program already registered in the client pc (ip passed in the POST request).
Has anyone gone through this or do you have any idea how to run a dll remotely with .net, java, php or other technology?

How to make a local test server for an android app?

I basically need to create a test server, something that I can use locally to perform tasks for my application.
So my android app is basically a search engine, however the search queries will be made on the server and the results then fetched from the server on the mobile device as JSON objects.
Is there any way to replicate this functionality locally? I would just like to set up a server, include the Spring framework, the Google Custom Search API and develop it all in Java, then ship it to a live server directly when it's finished. (Most presumably a free tier Amazon AWS server, either EC2 or Lambda, not sure what the difference is).
Not quite sure where or how to get started so any help is appreciated, thank you!
p.s. I may try dabbling in some machine learning at a later date, but I don't know if this will affect anything, this will most likely be after I've got a live server up and running.
EDIT: Sorry, so how would I fetch data from a local server from my mobile device? Do I need special software? Do I need to configure a local server? How can my mobile device fetch data from a second project when its being run on the first?
My app will fetch data from a server, so how can I create a dummy server, for it to fetch data from? Will I need to create a fully functioning online server, or can this just be done through creating a local server of some sort and then simply plugging my android device in and running the code? I have absolutely no idea how to test it without putting it online.
You can run a local installation of Tomcat server on your own machine.
Access the server by visiting "http://localhost:8080/" (or) http://127.0.0.1:8080". You can basically listening to your own local machine / host's 8080 port. Sometimes, it could be port 80 instead of 8080.
Please explore on how to host a Spring or Java application on a local server.
A good starting point would be to learn J2EE or Enterprise Java. You can configure Databases from your local installation.
If you opt for PHP as your language on server side, there is a pre-defined package called WAMP (for Windows), LAMP (for Linux), MAMP (for MAC) and XAMPP.
The above package are nothing but a package which contains a Server, Database and a Server side language usually PHP, if needed Python or Perl.
Please explain in which step you are getting issues so that anyone can help you exactly.

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.

from a java application running in a citrix session, how to know if the client workstation is idle?

we are currently developing java applications that run in a citrix environment. We need to react when the user is idle for a while.
The problem is that if the user is active outside the citrix application, say, for example, in a winword started locally on the client, how could we know it from the application in the citrix session.
We tried jna, that works perfectly if started locally. But in the citrix session, that does not work...
Any idea ?
The short answer is you can't, at least not easily. You would need to have some local program running on the user's local desktop that talks via some communication mechanism to your app on the Citrix Server to tell it when the user is really idle.
How you do this communication is up to you, but if you're really keen you could use the Virtual Channel SDK. This allows you to send your own custom commands over the Citrix HDX channel - this is a pretty low level wire comms mechanism however.
http://www.citrix.com/downloads/citrix-receiver/sdks/virtual-channel-sdk.html

Android game, local and online, with clients that can be used as servers, without duplicating code

I want to write an application for Android, a card game that can be played both locally and online. That means we have clients (Android phones), and servers. Ideally, an Android phone should be able to be used as a server and host a game (and play it at the same time). I don't want to duplicate code between the server and the client.
Here is what I had in mind: having the application contain the server part, that would be runnable indepently by the application itself, or without the application (on a computer).
In a local game, a thread would be run for the server, and another one for the client (which communicates with the local server through localhost). In an online game, a distant server is running, and the local client communicates with it through the network.
My questions are:
Will my application be able to communicate with a thread that comes from itself, through localhost?
Can I have the entire application as the server? On the phone, it would run the server thread, then the client thread (do I need one?). On the distant server (desktop computer), I would run only the server thread, without all the Android stuff.
Do you have an other idea?
I hope I have been clear enough for you to understand the problem.
Thanking you in advance.
Yes, your app could communicate with itself through TCP sockets, that shouldn't be a problem. I'd advise you to take a look at putting most of the server functionality into a jar file, then you would have an Android APK and potentially a separate Java frontend for your desktop. You will likely need to have a little hosting code that's specific to each platform. It might make sense to put your server in an Android Service for example if you want to be able to host in the background.

Categories

Resources