Search in sources :

Example 11 with FastCast

use of org.nustaq.fastcast.api.FastCast in project fast-cast by RuedigerMoeller.

the class MPPublisher method configureFastCast.

public static void configureFastCast() {
    // note this configuration is far below possible limits regarding throughput and rate
    FastCast fc = FastCast.getFastCast();
    fc.addTransport(new PhysicalTransportConf("default").interfaceAdr(// define the interface
    "127.0.0.1").port(// port is more important than address as some OS only test for ports ('crosstalking')
    42044).mulitcastAdr(// ip4 multicast address
    "229.9.9.13").setDgramsize(// datagram size. Small sizes => lower latency, large sizes => better throughput [range 1200 to 64_000 bytes]
    16_000).socketReceiveBufferSize(// as large as possible .. however avoid hitting system limits in example
    4_000_000).socketSendBufferSize(2_000_000));
}
Also used : PhysicalTransportConf(org.nustaq.fastcast.config.PhysicalTransportConf) FastCast(org.nustaq.fastcast.api.FastCast)

Example 12 with FastCast

use of org.nustaq.fastcast.api.FastCast in project fast-cast by RuedigerMoeller.

the class Issue4_Slow method setupFC.

public FastCast setupFC(String nodeId, String config) {
    System.setProperty("java.net.preferIPv4Stack", "true");
    try {
        // FastCast.getFastCast();
        FastCast fc = new FastCast();
        fc.setNodeId(nodeId);
        fc.loadConfig("./src/test/java/basic/" + config);
        return fc;
    } catch (Exception e) {
        e.printStackTrace();
    }
    return null;
}
Also used : FastCast(org.nustaq.fastcast.api.FastCast)

Aggregations

FastCast (org.nustaq.fastcast.api.FastCast)12 FCPublisher (org.nustaq.fastcast.api.FCPublisher)4 FCSubscriber (org.nustaq.fastcast.api.FCSubscriber)3 PhysicalTransportConf (org.nustaq.fastcast.config.PhysicalTransportConf)3 Bytez (org.nustaq.offheap.bytez.Bytez)3 Executor (java.util.concurrent.Executor)2 Histogram (org.HdrHistogram.Histogram)2 Sleeper (org.nustaq.fastcast.util.Sleeper)2 FSTStructAllocator (org.nustaq.offheap.structs.FSTStructAllocator)2 File (java.io.File)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 ObjectPublisher (org.nustaq.fastcast.api.util.ObjectPublisher)1 RateMeasure (org.nustaq.fastcast.util.RateMeasure)1