Commit fc45081d authored by Tigran Mkrtchyan's avatar Tigran Mkrtchyan
Browse files

rpc: dorp dependency on remotetea

parent df3e362b
......@@ -260,11 +260,6 @@
<!--
LOCAL JARS
-->
<dependency>
<groupId>org.acpt</groupId>
<artifactId>jportmap</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.dcache.chimera</groupId>
<artifactId>chimera-core</artifactId>
......
......@@ -19,8 +19,9 @@ package org.dcache.xdr;
import java.io.IOException;
import java.net.InetAddress;
import org.dcache.xdr.portmap.GenericPortmapClient;
import org.dcache.xdr.portmap.OncPortmapClient;
import org.acplt.oncrpc.OncRpcPortmapClient;
import org.dcache.xdr.portmap.OncRpcEmbeddedPortmap;
public class SimpleRpcServer {
......@@ -43,18 +44,22 @@ public class SimpleRpcServer {
new OncRpcEmbeddedPortmap();
OncRpcPortmapClient portmap = new OncRpcPortmapClient(InetAddress
.getByName("127.0.0.1"));
portmap.getOncRpcClient().setTimeout(2000);
portmap.setPort(PROG_NUMBER, PROG_VERS, IpProtocolType.TCP, port);
OncRpcClient rpcClient = new OncRpcClient(
InetAddress.getByName("127.0.0.1"),
IpProtocolType.UDP, 111);
XdrTransport transport = rpcClient.connect();
OncPortmapClient portmapClient = new GenericPortmapClient(transport);
portmapClient.setPort(100003, 4, "udp", "127.0.0.2.8.4", System.getProperty("user.name"));
RpcDispatchable dummy = new RpcDispatchable() {
@Override
public void dispatchOncRpcCall(RpcCall call) throws OncRpcException, IOException {
call.reply(XdrVoid.XDR_VOID);
}
};
};
OncRpcSvc service = new OncRpcSvc(port);
service.register(new OncRpcProgram(PROG_NUMBER, PROG_VERS), dummy);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment