[表示 : 全て 最新50 1-99 101- 201- 301- 401- 2chのread.cgiへ]
Update time : 06/28 16:47 / Filesize : 141 KB / Number-of Response : 468
[このスレッドの書き込みを削除する]
[+板 最近立ったスレ&熱いスレ一覧 : +板 最近立ったスレ/記者別一覧] [類似スレッド一覧]


↑キャッシュ検索、類似スレ動作を修正しました、ご迷惑をお掛けしました

【次世代】 Jxtaお勉強スレッド 【P2P】



1 名前:デフォルトの名無しさん [03/01/26 20:35]
P2Pの標準プロトコルを目指す Jxtaについてみんなでお勉強スレッドです。
初心者歓迎!質問歓迎!

関連ページ:
www.wakhok.ac.jp/~maruyama/jxta/  
www.atmarkit.co.jp/fjava/rensai/jxta01/jxta01_1.html
www.atmarkit.co.jp/fjava/special/jxta01/jxta01_1.html
www.janit.com/TechnoInf/Java/JXTA/JXTAPart1.html




205 名前:デフォルトの名無しさん mailto:sage [04/10/27 20:06:42]
public class PipeTest {
private PeerGroup peerGroup = null;
private PipeAdvertisement pipeAdv = null;
private boolean initialized = false;
private InputPipe inputPipe = null;
private OutputPipe outputPipe = null;
public void initializeJXTA() throws PeerGroupException
{
peerGroup = PeerGroupFactory.newNetPeerGroup();
}
public void startTest(){
pipeAdv =
(PipeAdvertisement) AdvertisementFactory.newAdvertisement(
PipeAdvertisement.getAdvertisementType());
pipeAdv.setName("Pipe for PipeStreamTest");
pipeAdv.setPipeID((ID) IDFactory.newPipeID(
peerGroup.getPeerGroupID()));
pipeAdv.setType(PipeService.UnicastType);
Server sv = new Server();
Client cl = new Client();
sv.start();
cl.start();

try {
sv.join();
cl.join();
} catch ( InterruptedException e) {}
}

206 名前:デフォルトの名無しさん mailto:sage [04/10/27 20:07:06]
public static void main(String[] args) {

PipeTest test = new PipeTest();
try {
test.initializeJXTA();
test.startTest();
} catch (Exception e) {
e.printStackTrace();
}
}

public class Server extends Thread implements PipeMsgListener {
JxtaBiDiPipe pipe;
public void run() {
try {
JxtaServerPipe server = new JxtaServerPipe(peerGroup, pipeAdv);
pipe = server.accept();
pipe.setListener(this);
} catch (IOException e) {e.printStackTrace(); }
try { sleep(100000); } catch (InterruptedException e) {}
}
public void pipeMsgEvent(PipeMsgEvent event) {
Message msg = event.getMessage();
System.out.println("Server: " + msg.getMessageElement("test").toString());
try { pipe.sendMessage(msg); } catch (IOException e) { e.printStackTrace(); }
}
}






[ 続きを読む ] / [ 携帯版 ]

前100 次100 最新50 [ このスレをブックマーク! 携帯に送る ] 2chのread.cgiへ
[+板 最近立ったスレ&熱いスレ一覧 : +板 最近立ったスレ/記者別一覧]( ´∀`)<141KB

read.cgi ver5.27 [feat.BBS2 +1.6] / e.0.2 (02/09/03) / eucaly.net products.
担当:undef