`
cuizhenfu#gmail.com
  • 浏览: 65985 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论
文章列表
加入一个ServerSocket正在另一个线程堵塞accept,那如何停止accept或者关闭Socket? Server socket 设置下超时 setSoTimeout 然后在Listen线程中用interrupt 其实直接close socket也可以,不过会抛出异常,我的意思是有什么比较安全而又简单的办法?难道要加一个标志,然后要关闭的时候把标志设为stop,然后连接listernSocket?这样也未免太麻烦了 JDK5.0里面新增了java.util.concurrent包(对于多线程的开发建议尽量使用这个包),下面是javadoc里面的样例代码 用法示例 下面给出了一个 ...
今天浏览jxta的官方网站,发现jxse更新到了2.5_rc2 rc2(24) rc1(27) net.jxta.util.AbstractSimpleSelectable.java net.jxta.util.AdvertisementUtilities.java net.jxta.util.AwtUtils.java net.jxta.util.ClassFactory.ja ...
注意第一行和第二行,每次for循环,都使用同一个buffer,这样当接收数据时,会抛出异常。可以将buffer的声明放在for循环的里面。另外注意在开发的时候,最好将所有异常的堆栈打出,这样便于及早发现问题。 java 代码   public void run() {      byte[] buffer = new byte[16384];       DatagramPacket packet = new DatagramPacket(buffer, buffer.length);      try {            ...
http://www.simplelife.cn/html/study/java/concurrent/threadPoolIn1.5.html JDK1.5中的线程池使用简介 在多线程大师Doug Lea的贡献下,在JDK1.5中加入了许多对并发特性的支持,例如:线程池。这里介绍的就是1.5种的线程池的简单使用方法。 创建日期:2005-05-11 最后修改日期:2007-03-06 panhaidong@gmail.com ...
在plugin的配置页的runtime项里, classpath里先new一个".", 再add自己的jar就可以了 另外,不要在project properties的java build path里做任何修改,在build配置页的Extra Classpath Entries添加外部包进行编译
System.getProperty("user.name")
The JxtaMulticastSocket class is useful for sending and receiving JXTA multicast packets. A JxtaMulticastSocket is a (UDP) DatagramSocket, with additional capabilities for joining "groups" of other multicast hosts on the internet. A multicast group is specified within the context of P ...
http://blogs.sun.com/hamada/date/20050824 有些地方不是很明白 Demystifying Pipes, JxtaSockets, JxtaMulticastSocket, and JxtaBiDiPipes Lately there has been several inquiries about JXTA's PipeService, and companion utilities (JxtaSocket, JxtaMulticastSocket, and JxtaBiDiPipe) on JXTA's d ...
在Jxta的世界里,Peer之间互相通讯都是通过Pipe来实现的,无论是原始的Pipe还是JxtaServerPipe、JxtaServerSocket,都需要PipeAdvertisement来实例化,并在底层使用Pipe进行通讯。 在同一个Peer中,PipeAdvertisement只能注册一次,例如如果已经使用一个PipeAdvertisement实例化了JxtaServerPipe,那么在使用同样的PipeAdvertisement来实例化JxtaServerSocket时,就会抛出不能注册输入管道异常。 但是不同的Peer,可以使用同一个(ID和名称可以相同)PipeAdvert ...
同一个pipe不能被注册多次 例如, 先使用PipeAdvertisement构造了一个JxtaServerSocket对象, 然后使用同一个PipeAdvertisement构造JxtaServerPipe对象,这是系统会抛出异常 java.io.IOException: Could not register input pipe (already registered) for urn:jxta:uuid-83A8BEEE6E0B421EB4059B445A02C0DA0B75BABF7FB9438EA2A7C0B9451056D304     at net.jxta.impl.pipe. ...
http://www.lmtw.com/p2p/Tcom/200510/16080.html PDP主要用来发布自己的广告信息,和查找其他Peer的广告。 如前篇文章所述,Advertisement是Peer之间各种信息交流的基本单元,发现其他Peer及其他Peer及其资源的问题就转换为发现描述各资源的Advertisement的问题,只要找到对应的Advertisement,就相当于找到了该资源。 PDP定义了发现其他Peer和资源的协议,该协议包括两个方面,一方面用于请求获得其他Peer的Advertisement;另一方面用于响应其他Peer的这种请求。 1.PDP的消息格式 P ...
http://blog.csdn.net/yanqlv/archive/2004/10/23/147982.aspx 还有一对JXTA的类JxtaSocket和JxtaServerSocket,实现的机理和上面的方法大致类似,根据JXTA开发者的说法,JxtaBidiPipe和JxtaServerPipe适用于小数据量应用,如即时消息,聊天信息等;而JxtaSocket和JxtaServerSocket适用于大数据量的通信,如文件传输等。我将在下一篇里分析JxtaSocket和JxtaServerSocket的例子。
1 安装SNMP服务,需原版Windows安装程序 2 运行,执行services.msc,启动SNMP Service服务,设置SNMP Service服务属性 代理-服务,复选框全部选择 陷阱-团体名称,public 陷阱-陷阱目标,填写服务器IP,例如192.168.17.137 安全-接受团体名称,public 3 运行,evntwin(陷阱转换器事件) 加入Application-SysmonLog,事件2031,消息灵通 4 计算机管理-系统工具-警报-新建警报设置,添加计数器
http://codeidol.com/java/java-concurrency/Cancellation-and-Shutdown/JVM-Shutdown/ 7.4. JVM Shutdown The JVM can shut down in either an orderly or abrupt manner. An orderly shutdown is initiated when the last "normal" (nondaemon) thread terminates, someone calls System.exit, or by other pla ...
用于创建InputPipe的Advertisement和用于创建OutputPipe的Advertisement(实际应为同一个,且通常每个Peer只实现一个) 用于创建JxtaServerPipe的Advertisement和用于创建JxtaBiDiPipe的Advertisement(同上) 用于创建JxtaServerSocket的Advertisement和用于创建JxtaSocket的Advertisement(同上) 其中,每对前面的Advertisement(即InputPipe、JxtaServerPipe、JxtaServerSocket)用于接收用户请求,每个Peer各不相 ...
Global site tag (gtag.js) - Google Analytics