Java: Writing a Datagram Client and Server from Eclipse - eclipse

I am Writing a Datagram Client and Server using eclipse with the class DatagramSocket. My question is: first I run the server from Eclipse, but when I run the client the server will continue work or just terminate ?

I wrote a server discovery system while attending computer networks course at my university, have a look:
https://github.com/colonder/Rudolph-server-discovery-system
It was a bit ago but as far as I remember both server and client are separate threads so one shouldn't kill the other, but I'm not so sure about running both things in the same Eclipse instance. When I was coding it at home I had only one machine available, so I guess it's possible to run both of them in the same Eclipse instance.

Related

Wildfly stops when running in debug mode in Eclipse

I installed Eclipse and the Jboss Tools plugin with Wildfly.
I can run Wildfly in Eclipse in non-debug mode with no problems. But when I start Wildfly in debug, I can use it for a few minutes, and then it suddenly stops processing, the server ends.
I checked the log and there's nothing. What could be wrong?
Please note the JBoss Tools 4.9.0 is validated against 2018-09 but not against 2018-12.
Do you see something in the server log when the server dies ?
We had this issue and it was because we changed our config to close the management port, which had been used to detect that the server had started. Eclipse could no longer detect that the server had started, so it shut down the process after a set time (450 seconds)
To resolve the issue, we did the following in the Eclipse's Overview panel for our JBoss Server:
Changed the Start Timeout to 30, so it would only fail if it actually couldn't start in 30 seconds rather than waiting for 450
Changed our "Server State Detectors" to detect a Web Port for Startup Poller and Process Terminated for Shutdown Poller.
Changed the Server Ports to match our new configuration
Excerpt from JBoss Community Archive
The tooling was unable to verify your server started. Our tooling has several methods to see if your server is up or not. The two most-often used methods are either "Web Port Poller" or "Management Poller".
You can see which your server is using by opening the server object (In Servers view, double-click your server) and on the right side you'll see a section on polling.
If your server adapter (fancy word for the tooling's representation of your server) is using the Management Port Poller, you should make sure your server is actually exposing the management port. For local servers this shouldn't be an issue, since local servers should automatically expose the management port. You may want to verify in the Ports section (also in the server editor) that the management port is correct. To check if the server is up, we run a management command against the server. If the server responds properly, we declare the server to be started.
If you're using the web port poller, then you may want to verify your web port is correct. To verify the server is up, the Web Port Poller opens a URL connection on {serverHost}:{webPort} and sees if we get a valid connection.

how to access client desktop and to control mouse using tcp/ip protocol from server machine

I'm working on project to develop an software using the TCP/IP protocol. The basic function of the software is to access the client activity running on client machine from server machine, for example information about current running applications.
Also, I want to access desktop screen and mouse from client machine to server machine using TCP/IP protocol. What are the basic steps that I can follow to access the desktop and could handle client mouse from server machine using TCP/IP.
It sounds like you want to build a VNC or RDP -like program. There have been an explosion of these services/programs in the time since you asked the question, though I don't know how many might be open source. I would start by investigating an Open Source VNC client and then see about adding an encrypted tunnel to keep the connection secure.
UltraVNC and TightVNC are popular Open Source VNC clients.

server communication

We have a Websphere app server with one cluster containing 2 servers. Each server contains our webapp. Each webapp/server talks to an single NCipher server though sockets. The NCipher server is listening for communications from each webapp/server on a common port.
If we reboot each of the Websphere servers in the cluster individually then we find that one connects straightaway but the other takes a variable amount of reboots before it connects. What I find confusing is why one connects immediately but the other doesn't.
What I have noticed is that connections are not being closed in the webapp. Not sure what impact this may have given that one of the servers is connecting fine once rebooted and the other doesn't.
Even though not closed I guess the connections do timeout, although closing them is definitely the correct thing to do.
Would anybody have any idea as to why this may be occuring ?

Simulate network lag when client and server are on the same dev PC

With my limited resources and to aid debugging, I am doing local testing on a client-server (game) application by running both a server and one or more clients all on my Windows 7 dev PC. Both client and server are Java applications developed through Eclipse.
Is there any easy way to introduce lag given that everything is running on the same PC... maybe 'hack' the port used or something? Or is this only possible if each application is running on a separate PC (or separate VM)?
Make a feature in the server which makes a random lag within certain time range if detected connection comes from localhost. You can then switch this feature on/off as needed.

Access running mono application via command line

What is the best way to access a running mono application via the command line (Linux/Unix)?
Example: a mono server application is running and I want to send commands to it using the command line in the lightest/fastest way possible, causing the server to send back a response (e.g. to stdout).
I would say make a small, simple controller program that takes in your required command line arguments and uses remoting to send the messages to the running daemon.
This would be similar to the tray icon controller program talking to the background service that is prevalent in most Windows service patterns.
Mono's gsharp tool is a graphical REPL that lets you Attach to Process.
#Rich B: This is definately a suitable solution, which I already had implemented - however on the server I have to use, the remoting approach takes around 350ms for a single request.
I've measured the time on the server side of the request handling - the request is handled in less than 10ms, so it has to be the starting of the client program and the tcp connection, that takes up the time.
Hence the hope that I can find another way to post the requests to the server application.
You can use the system.net.sockets abstractions to create a service on a TCP port, and then telnet to that port.
Check the library status page; Mono's coverage here is a bit patchy.