rpc

Android调用WebService

一笑奈何 提交于 2019-12-02 15:03:00
WebService是一种基于SOAP协议的远程调用标准,通过webservice可以将不同操作系统平台、不同语言、不同技术整合到一块。在 Android SDK中并没有提供调用WebService的库,因此,需要使用第三方的SDK来调用WebService。PC版本的WEbservice客户端库非 常丰富,例如Axis2,CXF等,但这些开发包对于Android系统过于庞大,也未必很容易移植到Android系统中。因此,这些开发包并不是在我 们的考虑范围内。适合手机的WebService客户端的SDK有一些,比较常用的有Ksoap2,可以从http://code.google.com /p/ksoap2-android/downloads/list进行下载;将下载的ksoap2-android-assembly-2.4- jar-with-dependencies.jar包复制到Eclipse工程的lib目录中,当然也可以放在其他的目录里。同时在Eclipse工程 中引用这个jar包。 具体调用调用webservice的方法为: (1) 指定webservice的命名空间和调用的方法名,如: SoapObject request =new SoapObject(http://service,”getName”);

Thrift RPC Golang、C++ Example

妖精的绣舞 提交于 2019-12-02 14:49:57
Thrift RPC Example 运行 请直接使用即可,无需拉取任何依赖包。 cd $GOPATH/src git clone https://github.com/hunterhug/thrift_example.git go build server.gp go build client.go ./server ./client $GOPATH 为环境变量,请替换为你的本地路径。 具体使用,详细介绍 gRPC是Google研究的RPC传输方案,thrift则是facebook, 大家都通过IDL(Interface Definition Language)接口定义语言来规范输入输出。 下载: https://thrift.apache.org/download Ubuntu 系统安装 sudo apt-get install automake bison flex git libboost-all-dev libevent-dev libssl-dev libtool make pkg-config build-essential g++ tar xvf thrift-0.12.0.tar.gz ./bootstrap.sh ./configure make sudo make install sudo ldconfig Windows系统请直接安装二进制。 建立

RPC的实现的三种方式

早过忘川 提交于 2019-12-02 14:48:52
package com.bjsxt.service; import java.rmi.Remote; import java.rmi.RemoteException; /*** * 创建需要发布的服务对应的业务接口 * @author Administrator * Remote 接口用于标识其方法可以从非本地虚拟机上调用的接口。 */ public interface UserService extends Remote{ public String helloRmi(String name) throws RemoteException; } 3.3 创建 UserServiceImpl 实现类 package com.bjsxt.service.impl; import java.rmi.RemoteException; import java.rmi.server.UnicastRemoteObject; import com.bjsxt.service.UserService; /*** * 创建发布的服务对应的实现类 * @author Administrator * */ public class UserServiceImpl extends UnicastRemoteObject implements UserService { public

ASM 实现RPC客户端

不打扰是莪最后的温柔 提交于 2019-12-02 14:31:31
通常RPC客户端都是通过动态代理来实现的。出于好奇,看看通过ASM生成客户端调用类,性能有没有JDK动态代理更好,想通过实践验证一下。 要想实现RPC的调用,需要做下面几件事情: 1:通过interface 实现调用类 2:通过遍历interface的各个方法,获取方法中参数及返回值类型等信息。 我们在MyClassVisitor.java文件中来完成这些功能: package com.jarvis.netty.rpc.aop.asm.impl; import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.FieldVisitor; import org.objectweb.asm.Label; import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.Opcodes; import org.springframework.asm.Type; import com.jarvis.netty.rpc.core.client.RpcClient; public class MyClassVisitor extends ClassVisitor implements Opcodes { private static final String

any good and simple RPC library for inter-process calls? [closed]

戏子无情 提交于 2019-12-02 14:09:42
I need to send a (probably one) simple one-way command from client processes to server process with arguments of builtin C++ types (so serialization is pretty simple). C++, Windows XP+. I'm looking for a library that doesn't require complicated configuration, provides simple interface, doesn't require hours to days of learning and doesn't have commercial usage restrictions. Simple solution for simple problem. Boost.Interprocess is too low-level for this simple task because doesn't provide RPC interface. Sockets are probably an overkill too because I don't need to communicate between machines.

Go micro 入门

和自甴很熟 提交于 2019-12-02 11:59:50
路由跳转 官方文档 本质上是选择不同的方式将HTTP信息合理的转发至后端处理,而不同的方式相当于不同请求的接收器,接收后再将其转发至不同的后端服务,完成整个请求的调用。 micro 将请求选择不同的方式转发并处理。 micro 支持 api/http/web/rpc 四种转发方式,其中 rpc 为默认方法。 都是通过 路由映射规则 将其转发至不同的客户端服务方法。 api 通过将http请求统一格式化为 github.com/micro/go-micro/api/proto 定义的格式进行处理; rpc 则是自定义proto或者使用服务的proto文件来限制请求格式。 未验证: web 则是将请求传递至客户端进行处理,后端重新映射为不同的路由,感觉可以用于第三方接口的映射; event 直接映射为事件方法 micro 支持/rpc直接调用微服务(方便调试),调用方式需要 micro api --handler api --enable_rpc true 进行开启。 调用请求: POST /rpc json格式: { "service": 服务名称, "method": 调用方法, "request": 调用参数 } 思考: api,http适合写业务逻辑,而service适合无业务逻辑开发。 来源: https://www.cnblogs.com/li1234yun/p

code after Gwt rpc AsyncCallbak will not be executed?

邮差的信 提交于 2019-12-02 11:48:56
问题 I can't understand why the code after the gwt rpc AsyncCallback will not be executed? for example I have the interface AppService extends RemoteService, So I'll have AsyncAppService which does the async call. the following code AppServiceAsync service = GWT.create (AppService.class); service.getCurrentUser(new AsyncCallback<Employee>(){ public void onFailure(Throwable caught) { } public void onSuccess(Employee result) { currentUser = result; } }); // if i have the code after the above call,

What RPC module should I use to implement RCP in Python and be able to change connection method later?

◇◆丶佛笑我妖孽 提交于 2019-12-02 11:27:02
I do have to implement some RPC from Python to Python but the connection methods are quite limited for security reasons. Currently it seems that I may be able to connect using SSH and run a single python script on the remote system. This can change in the future when we may have to connect using something else, maybe telnet so I would like a solution that can work using different protocols. Another potential limitation is regarding Python version, it has to work with Python 2.5-2.7 even if the client and the server are running different versions. What I should use, please suggest only if you

NFS

空扰寡人 提交于 2019-12-02 06:14:21
目录 1.nfs简介 1.1nfs特点 1.2使用nfs的好处 1.3nfs的体系组成 1.4nfs的应用场景 2.nfs工作机制 2.1PRC 2.2NIS 2.3nfs工作机制 3.exports文件的格式 4.nfs管理 5.实验 1.nfs简介 1.1nfs特点 NFS(Network File System)即网络文件系统,是FreeBSD支持的文件系统中的一种,它允许网络中的计算机之间通过TCP/IP网络共享资源 在NFS的应用中,本地NFS的客户端应用可以透明地读写位于远端NFS服务器上的文件,就像访问本地文件一样 nfs适用于Linux与Unix之间实现文件共享,不能实现Linux与Windows间的文件共享功能 nfs是运行在应用层的协议,其监听于2049/tcp和2049/udp套接字上 nfs服务只能基于IP进行认证,这也是它的缺点之一 1.2使用nfs的好处 节省本地存储空间,将常用的数据存放在一台NFS服务器上且可以通过网络访问,那么本地终端将可以减少自身存储空间的使用 用户不需要在网络中的每个机器上都建有Home目录,Home目录可以放在NFS服务器上且可以在网络上被访问使用 一些存储设备如软驱、CDROM和Zip(一种高储存密度的磁盘驱动器与磁盘)等都可以在网络上被别的机器使用。这可以减少整个网络上可移动介质设备的数量 1.3nfs的体系组成

搭建nfs服务器

瘦欲@ 提交于 2019-12-02 06:12:34
搭建nfs服务器 1.nfs简介 1.开放/nfs/shared目录,供所有用户查阅资料 1.安装nfs-utils,并开启rpcbind nfs-server 2.关闭防火墙 3.创建/nfs/shared目录 4.编辑文件/etc/exports,共享目录/nfs/shared并且允许所有客户端访问并且只有读的权限 5.用 exportfs -r读取/etc/exports文件中的设置,并使其立即生效,无需重启服务 6.在客户端上showmount -e 查看服务器上的共享目录 7.将服务器的共享目录挂载到本地的nfs目录里面 8.进入到nfs目录里就能看到服务器共享的资料了 2.开放/nfs/upload目录为172.16.12.0/24网段的数据上传目录,并将所有用户及所属的用户组都映射为nfs-upload,其UID与GID均为300 1.创建目录/nfs/upload 2.创建用户nfs-upload并且uid和gid都是300 3.编辑/etc/exports文件并且将目录/nfs/upload共享出来,让他只允许192.168.10.0/24网段访问并且所有用户及所属的用户组都映射为nfs-upload 4.用 exportfs -r读取/etc/exports文件中的设置,并使其立即生效,无需重启服务 5.在客户端上showmount -e 查看服务器上的共享目录