当前位置: 首页>>代码示例>>Java>>正文


Java Util.writeAddress方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:24,代码来源:STATE_SOCK.java

示例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);
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:8,代码来源:PingData.java

示例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;
    }
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:14,代码来源:NakAckHeader2.java

示例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;
    }
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:14,代码来源:NakAckHeader.java

示例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);
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:10,代码来源:GossipData.java

示例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);
        }
    }
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:28,代码来源:MergeView.java

示例7: writeTo

import org.jgroups.util.Util; //导入方法依赖的package包/类
public void writeTo(DataOutput out) throws Exception {
    out.writeShort(type);
    Util.writeAddress(from, out);
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:5,代码来源:VERIFY_SUSPECT.java

示例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);
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:6,代码来源:FD.java

示例9: writeTo

import org.jgroups.util.Util; //导入方法依赖的package包/类
@Override
public void writeTo(DataOutput out) throws Exception {
    Util.writeAddress(address, out);
    Bits.writeLong(id, out);
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:6,代码来源:MessageID.java

示例10: writeTo

import org.jgroups.util.Util; //导入方法依赖的package包/类
public void writeTo(DataOutput out) throws Exception {
    Util.writeAddress(creator, out);
    Bits.writeLong(id,out);
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:5,代码来源:ViewId.java


注:本文中的org.jgroups.util.Util.writeAddress方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。