simple Java api to form and send ntp packet [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 9 years ago.
Improve this question
We should feed some system under test with ntp data, that we should control. Since the testing environment is mainly java-oriented, it would be perfect to find and reuse any java code, that forms and send ntp packets. There is no matter, how precise this server side would be, since the main idea of the test to provide the mocked time through via ntp packets. Is there any ntp java library, or may be example, especially for netty usage?
I would appreciate for any suggestions. Thanks in advance!
UPD. Since the question is taken to 'on hold' (I don't understand why, ntp + java seems to be too familiar to local folks, but not to me), I'd like to summarize it to simple question:
Is there Java API that can provide ntp server packets on ntp client dmand being simple like NTPPacket ntpp=new NTPPacket(new Time()); while all other wirings will be default?

Ho-ho, I see some haters already started their downvotes; it seems they just see the title, but not the details of the issues (I really dislike this kind of haters)
I have even to remove 'java' tag here. So, my suggestion that I can reuse http://mvnrepository.com/artifact/org.apache.directory.server/apacheds-protocol-ntp/2.0.0-M15 for this purpose

Related

Java - What is the "industry standard" method to communicate between client and server in terms of using strings, etc [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
So usually, to have get and set methods in networking Java I use an enum, for example:
public enum MyEnum {
GET_NAME,
GET_ADDRESS;
}
etc. which the client application and server application would send between each other as a string and the appropriate task would be carried out.
I wanted to know how applications do this usually? What data do they send through the socket to make the program work, do they use ObjectStreams? Do they send bytes?
Wanted to know what the best practice would be to have a client-server setup for my own messaging application.
EXTRA INFO:
The client / server network I'm designing is for a PLUGIN in a GAME and therefore has to be instant / speedy ;)
All of that. Or something else.
The "industry" standard can be many things, depending on the domain you are looking at, or the decade when the solution was designed.
In 2018, most "new" client/server communication that gets defined doesn't operate on socket level. You rather define a set of restful APIs that the server offers, and data flows as JSON strings for example.
In other words: the official answer here is: there is no such as an industry-wide standard. To the contrary: what you are asking about (sending individual comments on socket level) is probably the exception, and not something that is common for real world architectures. People don't think in sockets and single commands. They think in terms of protocols, abstractions, maybe "remote procedure calls".

What is needed to make a packet capture system? [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 5 years ago.
Improve this question
I'm wondering what it would take (skills wise) to make a packet capture system that collects the destination of the packets and stores them, so any help would be appreciated!
I'm hoping to do it in Python or Java, if that helps.
What you're trying to develop already exists for many years, and with multiple implementations:
Wireshark
TCPDump.
Both applications can write the packets in the PCAP format. Bear in mind that these applications require root access and privileges as they ask the kernel to fork the incoming packets to your application.
I Think you need something like jpcap and jNetpcap is wrapping in java.
check out below links :
sniff network traffic in java
full example of network sniffing in java

Best way to transmit data between two applications [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
What is the best way to transmit data between two (Java) applications running on the same machine? One obvious idea would be to use standard Sockets but this doesn't feel right.
I've heard that most operating systems have a built-in system specifically for this task. How is it called and how does it work?
And is there any other good method to do something like that?
I think it depends on what you want to communicate between the applications and the size of your project. Some examples:
Sharing of state - use a database, files or similar
Messaging - use a socket. On top of a socket you have several technologies you can leverage, like HTTP/REST, but you can also create your own transport
There are also message applications you can leverage, like RabbitMQ

Best way of client server communication in Java [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I am building an application where in the requirement is that, there is a main server, which will send signal to client server, based on this signal the client performs certain action and send back the response to the main server. Here there will be only one main server and can be multiple client servers. At a given time the main server can send multiple signal to multiple clients.
I am presently planning to do this using socket programming in Java using two ports. Do let me know the best way of achieving this? and also do we have any good existing API's that can be used?
Take a look at RMI: https://docs.oracle.com/javase/tutorial/rmi/ If you want something based on sockets/TCP/UDP/etc, writing something with Netty may be good solution -> http://netty.io/ (they have useful examples).
I would also recommend to consider plain Java Sockets if planned communication beetween server and clients is not comlex and you do not need all this stuff which is provided by libraries like Netty.

Java Local Network Chat [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 spent much time researching how to create a chat system that would work between computers on the same local network, and so far have had no success (in Java). Could anyone provide me with references to things that actually work, or guide me?
Here are some useful resources that I found on Google.
http://java.sun.com/docs/books/tutorial/networking/sockets/index.html
http://www.youtube.com/watch?v=eANjtQ6wJv0
http://www.youtube.com/watch?v=eANjtQ6wJv0
There are many more if you just ask "how to make a LAN chat program in Java" in your favorite search engine. There are tutorials online, but it is recommended that you are pretty competent in the language as well as networking. Go back to the basics and read a bunch of books on Java.
For future reference, don't ask questions like that on Stack Exchange. Put problems that you have about code. Be specific!
You have two problems. One is discovery, the other is connections.
For discovery on the local network you want mDNS aka Bonjour.
jMDNS offers a pure java Bonjour implementation.
You need to setup a service advertisement and a service discovery.
Once you discover a service you can then connect to the daemon you have setup on each machine.

Categories