Вопрос

being lost with all the technologies, I am lost with the differences.

I want to have a client (Android) that connects to my server (Java language and windows machine) and be able to send data to it, process it on the server and receive answer back.

For the server portion, I was wondering whats the difference between having a java program that starts up a socket and listens for connection in a while loop VERSUS having Tomcat server with servletes?

Iam not sure if there are other solutions. But can you please enlighten me on the difference and your recommendation ? Thank you

Это было полезно?

Решение

Servlets are an abstraction layer on top of sockets. You don't have to know HTTP details to use Servlets (but it helps). You'll have to master HTTP and work much more to do the same job with sockets, but performance could be better.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top