简体   繁体   English

Java服务器和客户端/ RMI还是套接字?

[英]Java Server and client/ RMI or Socket?

I'm developing a Desktop LAN base java server and client application 我正在开发基于桌面LAN的Java服务器和客户端应用程序

where a Client must login and also to pass some data to server. 客户端必须登录并向服务器传递一些数据的地方。 assuming i have 10 clients that inserting record simultaneously to server. 假设我有10个同时向服务器插入记录的客户端。

which is the best approach in this kind of situation, should I use RMI for login and record insertion? 在这种情况下哪种方法最好?我应该使用RMI进行登录和记录插入吗? or Sockets? 还是插座?

if sockets please provide a key idea for me to start with. 如果是插座,请先提供一个关键的想法。

key points to consider -Multithreading -able to send back data on client 要考虑的关键点-多线程-能够在客户端上发送回数据

If you want to connect your server via internet (and/or firewalls) it is probably a hassle to do this with plain RMI. 如果要通过Internet(和/或防火墙)连接服务器,则使用纯RMI可能很麻烦。 In the past I have used Java Simon for such tasks which is very easy to implement. 过去,我将Java Simon用于此类任务,这很容易实现。 However if you plan to support other clients than Java clients, then you should have a look at Apache Thrift or Google Protocoll Buffers 但是,如果您打算支持Java客户端以外的其他客户端,则应该看看Apache ThriftGoogle Protocoll Buffers。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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