本文整理汇总了Java中org.jgroups.util.Util.writeAddress方法的典型用法代码示例。如果您正苦于以下问题:Java Util.writeAddress方法的具体用法?Java Util.writeAddress怎么用?Java Util.writeAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jgroups.util.Util
的用法示例。
在下文中一共展示了Util.writeAddress方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createStreamToProvider
import org.jgroups.util.Util; //导入方法依赖的package包/类
protected Tuple<InputStream,Object> createStreamToProvider(Address provider, StateHeader hdr) throws Exception {
IpAddress address=hdr.bind_addr;
Tuple<InputStream,Object> retval=new Tuple<>(null,null);
Socket socket=null;
try {
socket=getSocketFactory().createSocket("jgroups.state_sock.sock");
retval.setVal2(socket);
socket.bind(new InetSocketAddress(bind_addr, 0));
socket.setReceiveBufferSize(buffer_size);
Util.connect(socket, new InetSocketAddress(address.getIpAddress(), address.getPort()), 0);
log.debug("%s: connected to state provider %s:%d", local_addr, address.getIpAddress(), address.getPort());
DataOutputStream out=new DataOutputStream(socket.getOutputStream());
Util.writeAddress(local_addr, out);
retval.setVal1(new BufferedInputStream(socket.getInputStream(), buffer_size));
return retval;
}
catch(Throwable t) {
Util.close(socket);
if(t instanceof Exception)
throw (Exception)t;
throw new Exception("failed creating socket", t);
}
}
示例2: writeTo
import org.jgroups.util.Util; //导入方法依赖的package包/类
public void writeTo(DataOutput outstream) throws Exception {
Util.writeAddress(sender, outstream);
outstream.writeByte(flags);
Bits.writeString(logical_name,outstream);
Util.writeAddress(physical_addr,outstream);
Util.writeAddresses(mbrs, outstream);
}
示例3: writeTo
import org.jgroups.util.Util; //导入方法依赖的package包/类
public void writeTo(DataOutput out) throws Exception {
out.writeByte(type);
switch(type) {
case MSG:
case XMIT_RSP:
case HIGHEST_SEQNO:
Bits.writeLong(seqno, out);
break;
case XMIT_REQ:
Util.writeAddress(sender, out);
break;
}
}
示例4: writeTo
import org.jgroups.util.Util; //导入方法依赖的package包/类
public void writeTo(DataOutput out) throws Exception {
out.writeByte(type);
switch(type) {
case MSG:
case XMIT_RSP:
Bits.writeLong(seqno,out);
break;
case XMIT_REQ:
Util.writeStreamable(range, out);
Util.writeAddress(sender, out);
break;
}
}
示例5: writeTo
import org.jgroups.util.Util; //导入方法依赖的package包/类
public void writeTo(DataOutput out) throws Exception {
out.writeByte(type);
Bits.writeString(group,out);
Util.writeAddress(addr, out);
Bits.writeString(logical_name,out);
Util.writeAddresses(mbrs, out);
Util.writeAddress(physical_addr, out);
Util.writeByteBuffer(buffer, offset, length, out);
}
示例6: writeTo
import org.jgroups.util.Util; //导入方法依赖的package包/类
public void writeTo(DataOutput out) throws Exception {
super.writeTo(out);
// write subgroups
int len=subgroups != null? subgroups.length : 0;
out.writeShort(len);
if(len == 0)
return;
for(View v: subgroups) {
int index=get(v.getCreator());
out.writeShort(index);
// if we don't find the member, write the addres (https://issues.jboss.org/browse/JGRP-1707)
if(index < 0)
Util.writeAddress(v.getCreator(), out);
out.writeLong(v.getViewId().getId());
int num_mbrs=v.size();
out.writeShort(num_mbrs);
for(Address mbr: v) {
index=get(mbr);
out.writeShort(index);
if(index < 0)
Util.writeAddress(mbr, out);
}
}
}
示例7: writeTo
import org.jgroups.util.Util; //导入方法依赖的package包/类
public void writeTo(DataOutput out) throws Exception {
out.writeShort(type);
Util.writeAddress(from, out);
}
示例8: writeTo
import org.jgroups.util.Util; //导入方法依赖的package包/类
public void writeTo(DataOutput out) throws Exception {
out.writeByte(type);
Util.writeAddresses(mbrs, out);
Util.writeAddress(from, out);
}
示例9: writeTo
import org.jgroups.util.Util; //导入方法依赖的package包/类
@Override
public void writeTo(DataOutput out) throws Exception {
Util.writeAddress(address, out);
Bits.writeLong(id, out);
}
示例10: writeTo
import org.jgroups.util.Util; //导入方法依赖的package包/类
public void writeTo(DataOutput out) throws Exception {
Util.writeAddress(creator, out);
Bits.writeLong(id,out);
}