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'm working on a project to simulate skype app through lan which requires socket implementation if I'm to use java. There is no particular information available in the web on how to work on this subject. Any valuable tips are welcomed or suggestions are entertained.
Thanks in advance.
You've likely seen this, but Oracle provides some pretty in-depth documentation on sockets in Lesson: All About Sockets
In this series of lessons, you're shown how to read from and write to sockets in Java, thus sending data to and receiving data from the computer you're connected to. Perhaps you could start with something simple like sending audio files over LAN, then see if you can actively write audio to the socket which could then be read and played on the receiving machine.
EDIT: Good 'ol Bucky has a video on building an IM program using sockets in Java which should put you at a starting point for your mock-Skype application.
Best of luck!
Related
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
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'am wondering if there is a way to make a peer-to-peer or phone to phone connection, lets say is a chat room or a game online, it is required to have a server that accepts socket connections or is there an easy way to do this? I'am talking about android phone-to-phone application via sockets, cause I don't know where can I get a free java server to make this possible
You could probably host a server instance on one of the phones, have that phone connect to itself, and have the other phone connect to the hosting phone. This way would also allow for multiple phones to connect to eachother.
Although I haven't done any android programming i've been playing a game that does this through either wifi, or bluetooth...
I can't help you with code or anything but here's a link to the designer's blog
http://www.sleepingbeastgames.com/blog/
I answered in an answer because I can't comment yet :(
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 understand that Socket-based Communication is independent between programming languages. Which means, a socket program written in Java language can communicate to a program written in C or C++ socket
program. And I've see many similar questions like mine in Stack overflow and I appreciate those answers.
But I didn't get what I'm looking for. Can anyone answer this with example code as JAVA program as a Server and C++ program as Client which runs on different machine and how they communicate?
Thank You :)
Socket communication is basically sending a set of bits (data/packet as you would call at a higher level) from one port to another. Port is nothing but a file/IO stream that can listen to data or send data given the correct address. A valid address is a combination of valid IP address(depending on if you want local or remote communication) and port number.
To answer your question we basically are opening a file, writing or waiting to be written into from another application. So, file open, close, read, write has nothing to do with a programming language. Only thing that varies between different languages are the APIs or interfaces provided to achieve this purpose.
When you open a socket you mention about the protocol you want to use for this communication, it could be TCP/UDP based on the purpose of your application. The protocol decides how the packet/data being sent and received are ordered. Basically, trying to establish a common ground between the 2 parties trying to communicate.
Hope this answer helps!!
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.
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