📄 readme
字号:
JXTA-EX1 (11/14/01)
The following example is a simple JXTA peer applications.
The Server application creates a service advertisement that represent a
service and publishes it in the NetPeerGroup. The service advertisement is
represented as a Module class and spec advertisement. The Server
application publishes a module spec advertisement that contains a pipe
advertisement to contact the service. The server application starts the
Service, by creating an input pipe to receive messages from clients. The
service loops waiting for messages to arrive.
The Client Application discovers the service and creates an intput pipe to
connect to the service and send a message to the service.
Files:
=====
The package contains the following files:
README
Makefile
client/Client.java // client code
server/Server.Java // server code
server/pipeserver.adv // advertisement for the service pipe
classes/Client.class // client binary class
classes/Server.class // server binary 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 Server first
2) Start the client
1) to start the Server:
-------------------
Go to the Server 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 Server
This will start the server application. 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:
Jxta is now taking off. Please fasten your seat belts and extinguish all smoking materials.
Recovered PlatformPeerGroup
Start the Server daemon
jxta:ServiceAdvertisement :
Name : JXTA-EX1
Version : Version 1.0
Keywords :
PipeService :
jxta:PipeAdvertisement :
id : jxta://59616261646162614A757874614D5047FB248680D0EA4B298BE285180A2CA3EA0000000000000000000000000000000000000000000000000000000000000401
name : Pipe JXTA-EX1
Uri :
Provider : jxta.org
Security :
Code :
Waiting for client messages to arrive
2) start the client
-----------------
Go to the client 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 Client
This will start the client application. 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
Jxta is now taking off. Please fasten your seat belts and extinguish all smoking materials.
Start the Client
searching for the JXTA-EX1 Service advertisement
.we found the advertisement
jxta:ServiceAdvertisement :
Name : JXTA-EX1
Version : Version 1.0
Keywords :
PipeService :
jxta:PipeAdvertisement :
id : jxta://59616261646162614A757874614D5047FB248680D0EA4B298BE285180A2CA3EA0000000000000000000000000000000000000000000000000000000000000401
name : Pipe JXTA-EX1
Uri :
Provider : jxta.org
Security :
Code :
message "Hello my friend!" sent to the Server
You should see the following messages printed to the server.
Server: receive message: Hello my friend!
Waiting for client messages to arrive
Troubleshooting:
===============
1) make sure that you have setup the network configuration correctly. You
can remove the PlatformConfig and PlatformPeerGroup 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 server:
gnumake server
To make the client:
gnumake client
to run
gnumake run_server
gnumake run_client
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -