Tomcat / Web服务器与Java NIO /网络框架 [英] Tomcat/web server vs. Java NIO/Networking Framework

查看:133
本文介绍了Tomcat / Web服务器与Java NIO /网络框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,对于一个类,我正在实现一个服务器,它使用TCP和自定义应用程序层协议接收两种类型的连接。虽然对于课程来说,这就是项目需要完成的方式,我想知道使用像Tomcat或类似的Web服务器来接收所有传入通信的优点/缺点,而不是使用Java的NIO或像Mina这样的网络框架(我正在使用)或Netty(我想在某些时候玩它)。

Currently for a class, I'm implementing a server which receives two types of connections, using TCP, and a custom application layer protocol. Though for the class, this is how the project needs to be done, I was wondering about the advantages/disadvantages of using something like Tomcat or a similar web server to receive all incoming communication, vs. using Java's NIO or a networking framework like Mina (which I'm using) or Netty (which I want to play around with at some point).

虽然我问的是Java(因为它就是我的'特别是,非常欢迎您将其扩展到任何其他语言。

Though I'm asking about Java (because it's what I'm most comfortable with) specifically, you are more than welcome to expand this to any other languages.

我正在寻找关于性能,易用性,可扩展性的评论(无论是开发明智还是明智的用途,安全性,以及您认为可以放置信息的任何其他基础。

I'm looking for comments on performance, ease of use, scalability (both in how well it scales development wise and usage wise), security, and any other base you think you may put information on.

无论如何,任何输入都将非常感激。

Anyways, any input would be greatly appreciated.

问候,
Omar Ferrer

Regards, Omar Ferrer

推荐答案

我认为历史可以解释答案。

I think history sheds some light on the answer.

Tomcat早于人类Java NIO y年。当时认为传入请求和一个线程池的队列,每个请求一个线程是最好的。

Tomcat predates Java NIO by many years. The thinking at the time that a queue for incoming requests and a pool of threads, one thread per request was best.

数据表明Java NIO扩展得更好,JBOSS维护现在就使用它。

Data would suggest that Java NIO scales better, JBOSS maintains and uses it now.

我不会惊讶地发现Tomcat被重构为使用Netty。

I would not be surprised to learn that Tomcat was being refactored to use Netty.

这篇关于Tomcat / Web服务器与Java NIO /网络框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆