简体   繁体   中英

How to put Java ServerSocket online?

I have a Java program that uses ServerSocket to listen for connections on my local port. I want to put this online so other people can also run the client and connect. I just want the host to literally run my .java program in an infinite loop. All the cloud hosting sites talk about Apache, Maven, and databases but that all goes over my head. How can I get them to run my .java file in an infinite loop so people worldwide can connect to the server socket?

You can have your own server at home, you only need to contract to your Internet Service Provider and they will give you a publc IP and your server will be public.

Another option is to contract a cloud server like Amazon EC2, they have an option and give you a basic server free for a year.

https://aws.amazon.com/es/ec2/

Or you can contract a VPS virtual private server, it's a dedicated server online for you, it's like EC2 but without virtual machines

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM