How can I interact with a kernel(linux kernel)? [closed] - java

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
What i am trying to do is an app similar to teamviewer using java.I was thinking to get the Input stream (monitor's) and send it to client so that the other machine can show the screen. I learnt that kernel acts as an interface between hardware and software, and i end up asking about kernel's interaction. can u plz give me the idea so that i can get things done..
Am i doing things wrong??
Please help me out..

You can use a ScheduledExecutorService to perform an action or task after a specific delay (or at a specific time).
This is how you can trigger a thread and therefor the processor to perform instructions at a given time.
I was thinking to get the Input stream (monitor's) and send it to client so that the other machine can show the screen.
For this sort of question is it not to useful to think in terms of what the kernel is actually doing other than to not you can't pass an InputStream from one process to another, let alone one machine to another.
What you can do if establish a socket connection between the two machines and copy the InputStream into the Socket connection. At the other end you will get an InputStream which has all the data the original InputStream has.
I learnt that kernel acts as an interface between hardware and software, and i end up asking about kernel's interaction.
The kernel's role is to control and manage the TCP socket and the network adapter. The JVM interacts with the kernel for you so you don't need to know all the details, in fact you don't need to know the actual system call used which is useful as it can be different on different OSes.

Related

How to access the state of other computer processes in 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 6 years ago.
Improve this question
I am beginning to write a basic "study-buddy" program as a side project. One important feature I want to implement is that the program can access the state of other programs running to prevent you from accessing them / yell at you. For instance, if you had Chrome open to Facebook, or if you launched a video game.
First off, is this even possible/reasonable to accomplish in Java? Second, specifically with Chrome, how can I access the programs state from another program that I am writing? More generally, how can I access ALL programs running on the computer and check to see whether anything violates "study-permissible" programs?
I would put this as a comment, but my reputation point is not enough.
One way is using the commands the operating system provides. You can run a command with
Runtime.getRuntime().exec("<command name>");
This will give you the related process and you can get the output of that process just as manually running the process. Then, you can utilize the output.
Basically if the OS provides you that information manually, you should be able to get the information within Java.

How to transfer object through two processes? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
For example , I develop a connection pool as a server , and on the other application I want to use the connection existing in the pool , How can I get it ? they are in two processes ? and have different life circle ?
If you are talking about socket connections (i.e. your connection pool handles tcp connections), then you can't pass that connection from one process to another. However, you could have a connection from the second process to the server and relay the information to the second process (essentially acting as a proxy).
In general, you will need a way for the two processes to communicate. If they have a different lifecycle (which you hint at) and you need one process to pick up messages from the other process when it comes on line, then you will need a persistence and queuing mechanism as well. Depending on your needs there are many different ways to achieve this. Here are some examples: -
On the server, write the information to a socket and read it on the other process. You would use one of the Java messaging classes and might serialiaze the object information. This is non-persistent, but might be the easiest to begin with.
On the server, write the information to a file and signal either by a named semaphore, file or other means that there is information to be processed.
On the server, write the message to a guaranteed delivery queue (e.g. Amazon or Azure queue) so that it can be picked up by the other process when available.

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 read League Of Legends ingame chat in 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
I would like to read the League Of Legends chat during a match and log it all to a file.
Though I do not have the slightest idea how to actually connect to the server and read the chat.
Does anyone have a link or an idea how to accomplish this?
Regards
You'll have to do some reverse-engineering, since the game's source code is not available. This is likely illegal based on your local laws.
You'll need to use a tool such as Wireshark to figure out how packets are encoded and what is being sent. You'll likely see text strings some of the time, cluing you in to what is happening. By sorting packets and seeing their frequency when doing certain actions, you may be able to deduce what packets must be sent for authentication, keepalive, and chat, and what packets must be listened for.
You can then build a Java implementation using Socket or DatagramSocket for TCP or UDP, respectively, depending on what the original uses. This is quite a bit of work, however, a a major (and did I say possibly illegal?) undertaking. Even with games where the source is available, redeveloping arcane network protocols is difficult and due to lack of information, will require quite a bit of hardwiring (using byte arrays often) for parts of packets.
Just so you're aware, this is probably illegal and I'm fairly certain they'll close your account for this.
The author of this post, Stack Exchange (inc), Stack Overflow, any affiliated parties, or organizations, will not be held liable for any legal consequences you may face. You may choose to do this at your own risk
Edit: You could try to use Robot and simple OCR or text extraction of some sort. It's still a somewhat questionable activity from the standpoint of game administrators and not too reliable.

what is deep_ping [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 am not sure if this is the correct forum to ask this but i am not sure where to ask either. So here is my question:
what does "deep ping" mean. I tried google but still did not get any information about it. Also who does deep ping mean in web servlet`s context. Thanks.
I'm not sure it's the "official definition" if there is such a thing, but I've head "deep ping" used about functionality that allows you to (in contrast to a regular ping) send a message to the server that passes through as much of the webstack as possible before returning an "ok" response.
As an example, you can make a ping transaction that passes from the network straight down the stack to the database and there does a dummy select to read the ok from a dummy table and return that result. That allows you to (in contrast to a "normal ping" that tests only the network) have confidence that all layers in the application including the database are actually alive.
- Ping is one of the most basic and useful network commands. It sends request to networked computer and waits for response. It’s easy to ping single PC but it’s pain to ping dozens (or even hundreds) of them.
- The process of Pinging the entire Subnet which can have N nos of PCs are known as Deep Ping. Network scanners are usually used to do this....

Categories

Resources