代码如下
DataInputStream inputStream = null;
inputStream = cs.getMessageStream();
byte[] buf = new byte[4];
int readLength=inputStream.read(buf,0,buf.length);
po = new Pointer(MemoryBlockFactory.createMemoryBlock(readLength));
po.setMemory(buf);
int lens=po.getAsInt(0);
System.out.println("lens="+lens); 我读取C Server返回过来的信息 我读取前4个字节 为什么会在int readLength=inputStream.read(buf,0,buf.length);这里卡住 或直接不往下执行 高手帮忙看下 最好能提供下修改的代码 谢谢了
DataInputStream inputStream = null;
inputStream = cs.getMessageStream();
byte[] buf = new byte[4];
int readLength=inputStream.read(buf,0,buf.length);
po = new Pointer(MemoryBlockFactory.createMemoryBlock(readLength));
po.setMemory(buf);
int lens=po.getAsInt(0);
System.out.println("lens="+lens); 我读取C Server返回过来的信息 我读取前4个字节 为什么会在int readLength=inputStream.read(buf,0,buf.length);这里卡住 或直接不往下执行 高手帮忙看下 最好能提供下修改的代码 谢谢了
偶不会哦
帮你顶,等高人~
不怎么懂,期待老鸟帮你解决
读完了 就跳出循环 while
inputStream = cs.getMessageStream();
byte[] buf = new byte[4];
int readLength=inputStream.read(buf,0,buf.length);
po = new Pointer(MemoryBlockFactory.createMemoryBlock(readLength));
po.setMemory(buf);
是什么意思怎么得到的
inputStream = cs.getMessageStream();
byte[] buf = new byte[4];
int readLength=inputStream.read(buf,0,buf.length);
cs.getMessageStream(); 是怎么得到的 c的dll吗 你设置一下timeout试试看 是不是连接了后一直没有返回只 用一个 sniff 类似名字的截获一下 或者用一个 socket server软件模拟一下
在输入数据可用、检测到文件末尾或抛出异常之前,此方法将阻塞。
.getInputStream()));
http://blog.csdn.net/hzhxxx/archive/2009/12/09/4970196.aspx下列描述了JNSP(java network service platform)服务的部署和功能,如有不明白之处,自己查看源代码,我无力和没有太多时间回答太多的问题.
源代码一起提供,可以随意修改,发布,并商业化,但请保留作者的信息.为了技术的进步,请注意共享成就.目前已经发布于:http://download.csdn.net/source/1885332;http://hzhxxx.download.csdn.net/
如果查看后有技术问题探讨和建议的,欢迎致电致信联系.系统架构设计和实现有如下特点:
A. 采用 Accept-Connect 通讯模型,能统一管理系统中使用的所有 Socket 资源;
B. 系统支持通信和协议分离的实现原则,支持自定义协议解析模块;通信负责数据收发,协议负责数据鉴别,两者配合实现通信和协议的和谐工作;
C. 灵活支持业务处理功能重定义,分级支持慢业务和快业务的不同业务处理线程;
D. 丰富灵活的配置参数,能满足高扩展性;
E. 配合业务处理和通信模型,能异步的管理所有的交互步骤;
F. 分布式服务设计和部署,实现动态(热拔插)的增加和较少业务服务器,减少乃至拒绝单点服务;