📄 readme
字号:
Bidirectional Pipe (11/20/01)
The following example is a simple example of the
use of the Bidirectional pipe service. This creates two pipes
between two peers to create a bidirectional connection.
The following demonstrates the use of the Bidirectional PipeService.
The Bidirectional pipe service is used to create an accept
Bidirectional pipe and a connect pipe, and send a message
via the bidirectional pipe.
Files:
=====
The package contains the following files:
README
Makefile
connect/BidirectionalPipeTestApp.java // connect side code
accept/BidirectionalAcceptPipeTestApp.java // Accept side
Util.java // utility to save and read a pipe advertisement from a file
classes/net/jxta/test/util/BidirectionalPipeTestApp.class
classes/net/jxta/test/util/BidirectionalAcceptPipeTestApp.class
classes/net/jxta/test/util/Util.class
lib/jxta.jar
lib/jxtasecurity.jar
lib/log4j.jar
lib/beepcore.jar
lib/cryptix-asn1.jar
lib/cryptix32.jar
lib/jxtaptls.jar
lib/minimalBC.jar
lib/org.mortbay.jetty.jar
lib/servlet.jar
To Run the Example
==================
1) Start the Accept side first
2) Start the Connect side
1) to start the Accept Side:
-------------------
Go to the accept directory
cd server;
java -classpath ../classes:../lib/jxta.jar:../lib/log4j.jar:../lib/beepcore.jar:../lib/jxtasecurity.jar:../lib/org.mortbay.jetty.jar:../lib/servlet.jar:../lib/cryptix-asn1.jar:../lib/cryptix32.jar:../lib/jxtaptls.jar:../lib/minimalBC.jar net.jxta.test.util.BidirectionalAcceptPipeTestApp
This will start the accept bidrectional pipe application waiting for the
connection. The Platform configuration tool will shows up for you to
configure the network setup for your platform. If you run the client and
server on the same subnet you can disable the HTTP transpor (check the HTTP
enable button to disable it). When done type ok
You should see the following log from the server:
Starting jxta ....
Published bidir pipe urn:jxta:uuid-59616261646162614E504720503250336782D5D1971A47D8A7C8B5B7CD30DBE704
2) start the client
-----------------
Go to the connect directory
cd client;
java -classpath ../classes:../lib/jxta.jar:../lib/log4j.jar:../lib/beepcore.jar:../lib/jxtasecurity.jar:../lib/org.mortbay.jetty.jar:../lib/servlet.jar:../lib/cryptix-asn1.jar:../lib/cryptix32.jar:../lib/jxtaptls.jar:../lib/minimalBC.jar net.jxta.test.util.BidirectionalPipeTestApp
This will start the connect side of the Bidirectional pipe. The Platform configuration tool
will shows up for you to configure the network setup for your platform. If
you run the client and server on the same subnet you can disable the HTTP
transpor (check the HTTP enable button to disable it). If you want
to run the client and server on the same node, you have to select a
different port for the TCP/IP tramsport (97002) . When done type ok
You should see the following messages printed on the accept side
Sending bidir pipe ack.
BPS: Accepted pipe connection net.jxta.impl.util.BidirectionalPipeService$Pipe@5c86eb
Client said: Hello, World!
Troubleshooting:
===============
1) make sure that you have setup the network configuration correctly. You
can remove the PlatformConfig and cm in the client or
service directory and restart the
application the Configuration tool will show up
2) Make sure that the client discovers a valid advertisement. You should check
that the PipeAdvertisement id of the client and server Service advertisement
matches. In doubt you can remove the local cache (server/cm and client/cm)
To Build the Client and Server
==============================
Unix:
=====
Set PLATFORM environment to point the "platform/binding/java"
directory
To make the accept:
make accept
To make the connect:
make connect
to run
gnumake run_connect
gnumake run_accept
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -