Developing Peer to Peer application in Java [closed] - java

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
i've got a university project where i need to develop a peer to peer system in java for file sharing.
So in essence several users should be able to share files using the Peer to Peer System.
Can someone give me some guidelines about how to build this system??

For university project read some tutorial about sockets. I believe that this is what your professor is expecting from you. Take for example the following: http://www.oracle.com/technetwork/java/socket-140484.html
There are 2 general solutions: server-full and server-less. In case of server based solutions all your clients should be pre-configured with the server's IP address. Server opens server socket and starts listening. So, each client connects to server and registers. The registration is very simple: server just needs the client's IP. Now server holds a list of connected clients and sends the list to each client. To make peer2peer app each client opens server socket too. When client A wishes to connect to client B it just connects to its socket.
You can implement server-less solution. In this case you need some discovery mechanism based for example on broadcasting.
I hope this helps. Good luck.

You want to check JXTA. The site has moved to jxse.kenai.com. The practical JXTA II book has been made available for reading on Scribd.

Related

GCP: can one VM be on different networks with the same address? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
Question related to GCP (Google Cloud Platform):
can one VM be in different networks with one address?
I work with cloud providers (AWS, GCP, Azure) and use libraries for java (aws.sdk, azure.sdk, google.sdk).
In short: virtual machines are created in my application. Also, additional software is installed on these virtual machines.
This software runs on the same network.
I want to realize that this software can work in different networks.
For example, a security group (rules) is created for Azure.
Azure, like AWS, does not allow you to connect network interfaces from different VPCs to the same virtual machine instance.
To implement this approach, I had to create an additional security group using the azure.sdk library and the NetworkSecurityGroupInner class.
Nowhere can I find something similar for java for GCP.
Can you share some examples or interesting links or articles? I'll be very grateful.
Thanks.
Can one VM be in different networks with one address? the answer is yes. BUT you have to set two way network peering as this diagram:
Learn more about network peering:
https://cloud.google.com/vpc/docs/vpc-peering
for quick tutorial to get this see this good hands-on lab
https://www.qwiklabs.com/focuses/964?catalog_rank=%7B%22rank%22%3A6%2C%22num_filters%22%3A0%2C%22has_search%22%3Atrue%7D&parent=catalog&search_id=3929793

cannot access files in tomcat from another computer in the same network using ip address? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I installed tomcat 7 and deployed a file consisting of html files.
When I access it in my laptop using localhost:8080/project it worked.
And also when I typed (my IP at that instance) 192.168.1.26:8080/project it also worked.
But when I access it from another laptop which is in the same network using 192.168.1.26:8080/project I mean internet protocol address it shows error and can not connect. I want to access the html files on the another laptop. Suggest me a solution.
Sometimes computer firewall blocks access - try this
The firewall can be configured by: choosing the Windows Firewall from the Control Panel, then click on Exceptions -> Add Port and enter name and number: Tomcat, 8080 and leave transport protocol as TCP
You need to set the Tomact to listen to your machine local ip address(ex. 192.168.0.3).

Peer-to-Peer connection over the internet [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
Is there any way to make a peer-to-peer connection over the internet without a server?
The idea is to send files from one PC to another PC.
In order to do P2P networking over the Internet, you have to deal with several issues. Mainly, NAT Traversal and Firewalls. If you do not deal with these problems, your connections will be error-prone. It is best to use an existing P2P framework for this purpose. In Java, one of the major frameworks is JXSE which is an open-source implementation of the JXTA protocols. The project is now discontinued but there is plenty of documentation available. See, https://jxse.kenai.com.
If JXSE is too heavyweight/complex for your purposes, which it can be, I would use a smaller/simpler P2P library that implements some basic form of NAT Traversal or firewall hole-punching. This may not account for every case, but it may be able to work for the particular case at hand. There are a few of these open-source implementations available; Google it or look on GitHub.
Write an application (server) that opens a socket to listen on some arbitrary port. Write another application (client) that sends a request to the IP address and port of the host running the server.

Redirect Based On Access [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I know this may not be possible. Here is my question. I have a domain. It is for my game server (Minecraft). I would like to be able to have my domain be typed in as example.com in both the game client and the browser url, and go to different places. In the browser, it would redirect to the website, and in the game client, it would redirect to the game server IP. I can give more clarification if needed. Thanks
This is possible already because the Minecraft server's socket is listening to a different port than an HTTP port.
You should be able to run a webserver and a Minecraft server without any modifications because HTTP listens on port 80 and Minecraft runs on port 25565.
NOTE:
If you are at home, then you will need to also set your router to allow port-forwarding for those two ports. Also, port 80 may become blocked by your ISP.
You can use a SRV record so game server requests go to one place and web requests go to another.
If you have control over the server that the domain name is forwarded to you can use. If you are using a linux server I would recommend IP Tables. Example of Port Forwarding with IP Tables

VPN set up through cmd [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I am looking for a way to create a new VPN connection using only the command line. All I see in Google searches are how to connect to an existing VPN connection, which is through rasdial. Thanks.
You can try to use RAS API directly from Java.
If you want to create VPN connection from pure CMD, I'd try to append connection info to rasphone.pbk file in user's profile (%APPDATA%\Microsoft\Network\Connections\Pbk\rasphone.pbk).
For more ideas see How can I programmatically create a Windows VPN connection?
Cisco VPN can connect using the Command line.You can create your own script files that use the CLI commands to perform routine tasks, such as connect to a corporate server, run reports, and then disconnect from the server.
To display a list of all VPN Client commands, go to the directory that contains the VPN Client software, and enter the vpnclient command at the command-line prompt:
http://www.cisco.com/en/US/docs/security/vpn_client/cisco_vpn_client/vpn_client46/administration/guide/vcAch5.html

Categories