Code Monkey home page Code Monkey logo

barchart-udt's Introduction

barchart-udt's People

Contributors

andre77 avatar andrei-pozolotin avatar ccob avatar igoberman avatar mvberg avatar piwosz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

barchart-udt's Issues

barchart-udt class load error on raspberry pi when it use the armel

Hi @carrot-garden ,When i use the barchart-udt with the solft-float ABI on raspberry pi ,the loader will cause an problem
the details is

pi@raspberrypi ~ $ java -jar serverTest.jar 
Feb 17, 2013 12:12:22 PM com.barchart.udt.SocketUDT <clinit>
INFO: library location : ./lib/bin
Feb 17, 2013 12:12:22 PM com.barchart.udt.SocketUDT <clinit>
INFO: loader provider  : com.barchart.udt.lib.LibraryLoaderUDT
Feb 17, 2013 12:12:22 PM com.barchart.udt.lib.PluginPropsUDT <clinit>
INFO: ARCH/OS/LINK = arm/Linux/gpp
Feb 17, 2013 12:12:23 PM com.barchart.udt.lib.LibraryLoaderUDT load
INFO: Platform supported.
Feb 17, 2013 12:12:23 PM com.barchart.udt.lib.LibraryLoaderUDT load
INFO: Loading release libraries.
Feb 17, 2013 12:12:23 PM com.barchart.udt.lib.LibraryLoaderUDT load
WARNING: Release libraries missing: /home/pi/lib/bin/lib/arm-Linux-gpp/jni/libbarchart-udt-core-2.2.2-SNAPSHOT.so: /home/pi/lib/bin/lib/arm-Linux-gpp/jni/libbarchart-udt-core-2.2.2-SNAPSHOT.so: cannot open shared object file: No such file or directory
Feb 17, 2013 12:12:23 PM com.barchart.udt.lib.LibraryLoaderUDT load
INFO: Loading staging libraries.
Feb 17, 2013 12:12:23 PM com.barchart.udt.lib.ResourceManagerUDT extractResource
WARNING: classpath resource not found: /barchart-udt-core-2.2.2-SNAPSHOT-arm-Linux-gpp-jni/lib/arm-Linux-gpp/jni/libbarchart-udt-core-2.2.2-SNAPSHOT.so
Feb 17, 2013 12:12:23 PM com.barchart.udt.lib.LibraryLoaderUDT load
WARNING: Staging libraries missing: resource not found
Feb 17, 2013 12:12:23 PM com.barchart.udt.lib.LibraryLoaderUDT load
INFO: Loading testing libraries.
Feb 17, 2013 12:12:23 PM com.barchart.udt.lib.ResourceManagerUDT extractResource
WARNING: classpath resource not found: /libbarchart-udt-core-arm-Linux-gpp.so
Feb 17, 2013 12:12:23 PM com.barchart.udt.lib.LibraryLoaderUDT load
WARNING: Testing libraries missing: resource not found
Feb 17, 2013 12:12:23 PM com.barchart.udt.SocketUDT <clinit>
SEVERE: Failed to LOAD native library
java.lang.IllegalStateException: Fatal: library load failed.
    at com.barchart.udt.lib.LibraryLoaderUDT.load(LibraryLoaderUDT.java:75)
    at com.barchart.udt.SocketUDT.<clinit>(SocketUDT.java:142)
    at com.barchart.udt.nio.SelectorProviderUDT.openServerSocketChannel(SelectorProviderUDT.java:117)
    at us.sosia.net.udt.channel.UDTServerSocketChannel.openChannel(UDTServerSocketChannel.java:66)
    at us.sosia.net.udt.channel.ServerTest.main(ServerTest.java:72)

Exception in thread "main" java.lang.ExceptionInInitializerError
    at com.barchart.udt.nio.SelectorProviderUDT.openServerSocketChannel(SelectorProviderUDT.java:117)
    at us.sosia.net.udt.channel.UDTServerSocketChannel.openChannel(UDTServerSocketChannel.java:66)
    at us.sosia.net.udt.channel.ServerTest.main(ServerTest.java:72)
Caused by: java.lang.RuntimeException: load
    at com.barchart.udt.SocketUDT.<clinit>(SocketUDT.java:146)
    ... 3 more
Caused by: java.lang.IllegalStateException: Fatal: library load failed.
    at com.barchart.udt.lib.LibraryLoaderUDT.load(LibraryLoaderUDT.java:75)
    at com.barchart.udt.SocketUDT.<clinit>(SocketUDT.java:142)
    ... 3 more

I know the cause of the this probleam
you can have a look at here
(#issue 28 )[https://github.com/sarxos/webcam-capture/issues/28]
and the cause detail may be found here:
(discuss #364)[https://github.com/nativelibs4java/nativelibs4java/issues/364]

When i change to raspberry runtime to the armhf ,it runs OK

can you fix this ?make the resource extract and load both OK on the hard-float and armel ?

i have implement some codec

hi there,i have implemented some codec ,and all have passed the test,i will pull them after i 100% sure that them works so well
,
thanks your guys hard work

Receive file question

Hi there, me again.

Im testing the receiveFile(file, 0, file_size) method but i cant get it working.

        // Receive the file length, in bytes
        byte[] buffer = new byte[8];
        receiver.receive(buffer);
        log("file size = " + toLong(buffer));
        long file_size = toLong(buffer);

        // receive the file...
        File file = new File("C:\\temp\\udtfile.tar.gz");
        receiver.receiveFile(file, 0, file_size);

First it was not working because seems that its not enough to create a new File(), the file have to exists before on the folder. I created the file by hand then.

Second, seems the file_size have to match the real file size? how it is this possible? i have to copy raw data to the file until reach the file_size parameter?

Ill appreciate some help on this, thanks in advance....

close the channel,but this occur the native side cancel the sending queue

HI,Andrei Pozolotin,
I was using this lib to sending the file,via

 fileChannel,transferTo()

But I found that if I close the channel when the sender has sent all the data on java side view.Then the remote peer would not get any more data.

for the Network issue ,this may be cause that,the native side is still sending some data ,and the java side just seems like all the data has been sent.Then the native side will just cancel all the message in the queue (I am not that sure ,but I think that UDT must has some data structure like this on the native side).As an result the remote peer will just receive an broken data.

So,is there have some method that let the java side know ,that not all the data has been seet.
or just block the close request or just pending it ,then the native side can sending out all the message.

when the barchart-udt is going to been used with netty ,This may be an issue too,the java side sent,the native side not.

I really hope that I could make you clear about this ,sorry for my bad English.

finish epoll selector tests

after i test the nio server side after a few seconds ,the server is shutdown with the exception below,but the client is still write the data to the socket channel,cause the selector selected the selectionKey can write

xajlsdfkjalsdfkjlasdfkjasdf
xajlsdfkjalsdfkjlasdfkjasdf
Exception in thread "main" com.barchart.udt.ExceptionUDT: UDT Error : 2001 : connection was broken : recv/recvmsg (socketID=853385151)
at com.barchart.udt.SocketUDT.receive1(Native Method)
at com.barchart.udt.SocketUDT.receive(SocketUDT.java:514)
at com.barchart.udt.nio.ChannelSocketUDT.read(ChannelSocketUDT.java:222)
at us.sosia.net.udt.NIOServerTest.main(NIOServerTest.java:46)

implement netty support

i want to use this with netty ,i think this goal can be archived with an UDT agent and an channel handler implement

null pointer exception on the socketChannel.configureBlocking(false);

Exception in thread "pool-1-thread-1" java.lang.NullPointerException
at com.barchart.udt.nio.ChannelSocketUDT.implConfigureBlocking(ChannelSocketUDT.java:83)
at java.nio.channels.spi.AbstractSelectableChannel.configureBlocking(AbstractSelectableChannel.java:285)
at us.sosia.net.udt.channel.UDTServerSocketChannel$Boss.run(UDTServerSocketChannel.java:113)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)

Fake getTcpNoDelay for SSL sockets to work

I've come across one use case (in a browser running an applet) that the SSL socket implementation is checking the property getTcpNoDelay on the NetSocketUDT. At the moment this currently throws an RuntimeException that it's unsupported.

Caused by: java.lang.RuntimeException: feature not available
    at com.barchart.udt.net.NetSocketUDT.getTcpNoDelay(NetSocketUDT.java:168)
    at sun.security.ssl.BaseSSLSocketImpl.getTcpNoDelay(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.writeRecordInternal(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.writeRecord(Unknown Source)

We should either return a true or false. This is a snippet from the OpenJDK implementation of the SSL socket.

        if (holdRecord) {
            // If we were requested to delay the record due to possibility
            // of Nagle's being active when finally got to writing, and
            // it's actually not, we don't really need to delay it.
            if (getTcpNoDelay()) {
                holdRecord = false;
            } else {
                // We need to hold the record, so let's provide
                // a per-socket place to do it.
                if (heldRecordBuffer == null) {
                    // Likely only need 37 bytes.
                    heldRecordBuffer = new ByteArrayOutputStream(40);
                }
            }
        }

Since UDT doesn't have a Nagle algorithm or similar, my gut instinct would be to return false instead of a RuntimeException. At least this should satisfy SSL. Whats your feeling on this?

warning: #warning Please include winsock2.h before windows.h

escalate to Yunhong Gu
http://www.linkedin.com/in/yunhong

In file included from c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.5.1/../../../../x86_64-w64-mingw32/include/ws2tcpip.h:11:0,
                 from ..\src\main\c++\udt\src\udt.h:52,
                 from ..\src\main\c++\udt\src\common.h:53,
                 from ..\src\main\c++\udt\src\epoll.cpp:50:
c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.5.1/../../../../x86_64-w64-mingw32/include/winsock2.h:15:2: warning: #warning Please include winsock2.h before windows.h

receive so slow on one android device but on others OK

Hi ,Andrei Pozolotin:

I am using the your barchart-udt to handle the live video stream on android side and pc/raspberry side.but i found an very strange thing is that.udt receive data OK on galaxy nexus which has only one CPU core,and another lenove Dual-Core Device,But when it comes to the SmartDevice's Ten3,which using TI 4430 and now is Android 4.2,will receive the data delay ,or so slow,as you can see,this would cause the OOM Finally .

I don't know why this happen ,do you have any idea?
Thanks ,and Thanks for your efforts on netty's udt transport.

Barchart-udt does not build under JDK 1.7.0_17 on Mac OS X

Compiling with JDK 1.7.0_17 + Maven 3.0.5 on OS X 10.8.3, I get the following errors:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project barchart-udt-core: Compilation failure: Compilation failure:
[ERROR] barchart-udt/barchart-udt-core/src/main/java/com/barchart/udt/nio/SelectorProviderUDT.java:[24,7] error: SelectorProviderUDT is not abstract and does not override abstract method openDatagramChannel(ProtocolFamily) in SelectorProvider
[ERROR] barchart-udt/barchart-udt-core/src/main/java/com/barchart/udt/nio/SocketChannelUDT.java:[56,7] error: SocketChannelUDT is not abstract and does not override abstract method getRemoteAddress() in SocketChannel
[ERROR] barchart-udt/barchart-udt-core/src/main/java/com/barchart/udt/nio/ServerSocketChannelUDT.java:[41,7] error: ServerSocketChannelUDT is not abstract and does not override abstract method setOption(SocketOption,T) in ServerSocketChannel
[ERROR] -> [Help 1]

Version: barchart-udt-core 2.2.6-SNAPSHOT / commit abc9d53

Any suggestions on how to proceed?

Thanks!
J

Reloading barchart UDT for a second time within the same JVM crashes

It seems if you reload barchart for a second time within the JVM, it causes the JVM process to crash with a SIGSEGV. Here is what I have found so far with various stack traces

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 15104.0x3140]
0x6d885aa4 in jvm!JNI_GetCreatedJavaVMs () from C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll
(gdb) bt
#0  0x6d885aa4 in jvm!JNI_GetCreatedJavaVMs () from C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll
#1  0x6d885e4f in jvm!JNI_GetCreatedJavaVMs () from C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll
#2  0x05ad963f in JNIEnv_::NewObject (this=0x2521528, clazz=0x0, methodID=0x6cf5058)
    at C:/src/barchart-udt-github/barchart-udt-core/src/cdt/jni/include/jni.h:854
#3  0x05aca0ba in UDT_NewExceptionUDT (env=0x2521528, socketID=19235400, errorCode=-3,
    message=0x5af1984 "unsupported option class in OptionUDT")
    at ..\src\main\c++\jni\com_barchart_udt_SocketUDT.cpp:236
#4  0x05aca14b in UDT_ThrowExceptionUDT_Message (env=0x2521528, socketID=19235400,
    comment=0x5af1984 "unsupported option class in OptionUDT")
    at ..\src\main\c++\jni\com_barchart_udt_SocketUDT.cpp:249
#5  0x05acc658 in Java_com_barchart_udt_SocketUDT_setOption0@20 (env=0x2521528, self=0x59deb00, enumCode=2,
    klaz=0x59deaf8, objValue=0x59deaf4) at ..\src\main\c++\jni\com_barchart_udt_SocketUDT.cpp:971

Java Stack Trace

j  com.barchart.udt.SocketUDT.setOption0(ILjava/lang/Class;Ljava/lang/Object;)V+0
j  com.barchart.udt.SocketUDT.setOption(Lcom/barchart/udt/OptionUDT;Ljava/lang/Object;)V+28
j  com.barchart.udt.SocketUDT.setBlocking(Z)V+34
j  com.barchart.udt.nio.ServerSocketChannelUDT.implConfigureBlocking(Z)V+5
j  java.nio.channels.spi.AbstractSelectableChannel.configureBlocking(Z)Ljava/nio/channels/SelectableChannel;+55

It looks like it's actually trying to make a call to setOption0 with the UDT_RCVSYN enum value, but then determines that it's an unsupported option, which is obviously wrong. Checking further up the C code it seems it's checking using this method.

if (env->IsSameObject(klaz, jdk_clsBoolean)){
}

So my guess is that jdk_clsBoolean is from a the first class loader, so when it get's reloaded, klaz is actually pointing to a different version of the Boolean class in the new class loader.

So I think we need to somehow check that barchart is being used without the previous one being unloaded correctly or similar. Not sure how yet though

JNI global references cleanup

Ideally we could do with a static cleanup function so the user can call it when UDT is no longer required. At this point we can then clean up the JNI global references, as currently they prevent the class loader from unloading.

Add change log with your release

Hi ,thanks for your team great work.
can you add an change log at the wiki or anyway,can you add an change list or release change log with your release?
thanks .

Issue with SocketChannelUDT blocking/non blocking sync with backing SocketUDT

I think I have found an issue with synchronization of the blocking state between the SocketChannelUDT and the underlying SocketUDT state.

By default a SelectableChannel is configured to be in the blocking state. From the docs it states

'Newly-created selectable channels are always in blocking mode. Non-blocking mode is most useful in conjunction with selector-based multiplexing. A channel must be placed into non-blocking mode before being registered with a selector, and may not be returned to blocking mode until it has been deregistered.'

So when the SocketChannelUDT is constructed, it makes a call to isBlocking and stores a volatile copy of the result. Which on construction is true due to contract specs, but since the default for SocketUDT is false (non-blocking), they are out of sync initially. This also means you cannot change the blocking mode to true without first switching to false since the AbstractSelectableChannel's default behavior is not to even call implConfigureBlocking if it thinks the channel state is the same as what is being requested.

What do you think?

If so, I think it should be a simple matter of switching the SocketUDT inside the SocketChannelUDT to blocking initially so that they are in sync, then configureBlocking on the channel to true will work as normal.

IPv6 SocketUDT

The com.barchart.udt.SocketUDT class states clearly:

note: current implementation supports IPv4 only (no IPv6)

Is there any hope to see a IPv6 ready SocketUDT in a future release ?

Btw, thanks for this great piece of work, I play with the Netty integration and take a lot of fun.

ip no_fragment flag

We ran into problems with UDT Stream connections from a private network towards a public cloud server. The problem only occurred when the UDP packets exceeded the MTU.

We saw that packets with a size of 1500 bytes did not reach their destination. The reason was that some router in the network had an MTU size of 1488 and just dropped the packets, this happened because the IP flag IP_DONTFRAG was set in the packet.

Now why is this flag set? I looked in the C++ code but could not find it (probably because I don't know enough of C/C++) so I just ask here. Is the UDT C++ implementation setting this flag and why?

Note: We can bypass the problem by lowering the MTU size of the sending computer, but in a production environment we don't have control over this so there must be another solution...

transport speed may be a little slow

i using this with the NIO and implement some handler to send file to the remote peer
.i test the code in int LAN,and use the filechannel and the socketchannel to exchange an file between 2 computer,
the speed is only 1.2Mbit/s,i think that may be a little slow.. i will keep going to improve this

receiving 19KB/S sending 1.2MiB/S

receiving 1.2MiB/s sending 19KB/S

NoSuchFieldError on last just released jdk

Caused by: java.lang.RuntimeException: init
at com.barchart.udt.SocketUDT.(SocketUDT.java:153)
... 3 more
Caused by: java.lang.NoSuchFieldError: port
at com.barchart.udt.SocketUDT.initClass0(Native Method)
at com.barchart.udt.SocketUDT.(SocketUDT.java:150)
... 3 more

hi ,barchart ,cause the oracle change the class InetSocketAddress's implement in the last release,so your native binding which get the filed id such as addr and port of the InetSocketAddress class will cause an error,not the change is moving the addr and port field to an inner class:

public class InetSocketAddress
    extends SocketAddress
{
    // Private implementation class pointed to by all public methods.
    private static class InetSocketAddressHolder {
        // The hostname of the Socket Address
        private String hostname;
        // The IP address of the Socket Address
        private InetAddress addr;
        // The port number of the Socket Address
        private int port;

        private InetSocketAddressHolder(String hostname, InetAddress addr, int port) {
            this.hostname = hostname;
            this.addr = addr;
            this.port = port;
        }
.....

    public InetSocketAddress(InetAddress addr, int port) {
        holder = new InetSocketAddressHolder(
                        null,
                        addr == null ? InetAddress.anyLocalAddress() : addr,
                        checkPort(port));
    }

.....

    private final transient InetSocketAddressHolder holder;

this change may be cause you guys to rewrite the native binding ...

AbstractMethodError when get the address

Hi ,i always get this issue when i was trying to get the remote socket address ,I reported this issue before

Exception in thread "udt client socket reader" java.lang.AbstractMethodError: java.nio.channels.SocketChannel.getRemoteAddress()Ljava/net/SocketAddress;
    at us.sosia.net.client.relay.RelayClient$1.onMessageReceved(RelayClient.java:49)
    at us.sosia.net.udt.channel.DataWorker.readData(DataWorker.java:113)
    at us.sosia.net.udt.channel.DataWorker.access$0(DataWorker.java:74)
    at us.sosia.net.udt.channel.DataWorker$2.run(DataWorker.java:151)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)

I using it as this :

    @Override
            public void onMessageReceved(SocketChannel socketChannel,
                    ByteBuffer byteBuffer) {
                try {
                    System.out.println("message received :"+socketChannel.getRemoteAddress());
                } catch (IOException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                }

                super.onMessageReceved(socketChannel, byteBuffer);
            }


I haven't try this in netty 4,the version is barchart 2.2.2

Send/Receive Tutorial

Hi there, im trying to use barchart-udt in my projects but im a little bit confused to get started.

I made to applications (server/client) to test but my server is hanging after receiving the packages.

Im sending a file in pieces, the server gets the file ok but he never close it and never finish the receive process. I can only access the file after the server application is interrupted by hand.

There is any tutorial with code examples to help?

Thanks in advance.

UDT netty4 example raise exception

Hi man,thanks for your great effort ,and when I was trying to check your code,and find out how to work with netty,the Echo Msg example always raise the exception,so does the netty 4 beta3.you may take a look at this .

Please take a look at it.
netty/netty#1104

Next release cut

What issues/features do you plan on getting fixed/implemented before the next release cut. I have a downstream project that I am getting close to releasing, but i'd rather not fork barchart-udt and cut my own release just to satisfy maven-release-plugin.

Thanks.

keep the session alive under the protocol

com.barchart.udt.ExceptionUDT: UDT Error : 2001 : connection was broken : recv/recvmsg (socketID=225481834)
at com.barchart.udt.SocketUDT.receive1(Native Method)
at com.barchart.udt.SocketUDT.receive(SocketUDT.java:514)
at com.barchart.udt.nio.ChannelSocketUDT.read(ChannelSocketUDT.java:222)
at us.sosia.net.udt.channel.DataWorker.run(DataWorker.java:50)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)

when i test the code,i see this after i close the connection on one side,i just wondering could you just implement the UDT channel keep alive mechanism,which may means it send the control package to the
remote peer,and silently drop it,like the heart beat package.and if the peer don't read any package from the remote peer,just notify the user that the connection is broken via an handler.

one more thing,if use this UDT with the p2p implement,i think the rendezvous method need to implement too,even the UDT's c++ implement contains this feture.

thanks

Reinstate select call

Can we reinstate the select call to make the API as compatible as possible. My code relied on select and does not use nio. It seems select has been removed in the 2.2 line, and proper use of epoll seems to be heavily dependent on NIO and Selectors.

build environment

Hello,

I would like to experiment with the barchart-udt implementation and would like to make some changes.
However I'm having trouble setting up the build environment. I cloned the repository and did a mvn install, but I immediately run into an maven "Unresolveable build extension".

Is there some documentation on how to setup the build environment?

Thanks!

throw the ExceptionUDT

when i read your code,i see that you it don't throw the exceptionUDT out in the ChannelSocketUDT line 197,you just signed it throw an IOExcetion ,the exception is from the read method.
,i think that:"throw the excetion UDT may be good,otherwise,there need an re-throw with any wrapper"
the current implement make the library user lose the underline error info
@OverRide
public final int read(ByteBuffer buffer) throws IOException {

    if (buffer == null) {
        throw new NullPointerException("buffer == null");
    }

    final int remaining = buffer.remaining();

    if (remaining > 0) {

        final SocketUDT socket = socketUDT;
        final boolean isBlocking = isBlockingMode;

        final int sizeReceived;
        try {
            if (isBlocking) {
                begin(); // JDK contract for NIO blocking calls
            }
            if (buffer.isDirect()) {
                sizeReceived = socket.receive(buffer);
            } else {
                assert buffer.hasArray();
                byte[] array = buffer.array();
                int position = buffer.position();
                int limit = buffer.limit();
                sizeReceived = socket.receive(array, position, limit);
                if (0 < sizeReceived && sizeReceived <= remaining) {
                    buffer.position(position + sizeReceived);
                }
            }
        } finally {
            if (isBlocking) {
                end(true); // JDK contract for NIO blocking calls
            }
        }

        // see contract for receive()

        if (sizeReceived < 0) {
            log.trace("nothing was received; socketID={}",
                    socket.getSocketId());
            return 0;
        }

        if (sizeReceived == 0) {
            log.trace("receive timeout; socketID={}", socket.getSocketId());
            return 0;
        }

        if (sizeReceived <= remaining) {
            return sizeReceived;
        } else { // should not happen
            log.error("unexpected: sizeReceived > remaining; socketID={}",
                    socket.getSocketId());
            return 0;
        }

    } else {
        return 0;
    }
}

@Override
public long read(ByteBuffer[] dsts, int offset, int length)
        throws IOException {
    throw new RuntimeException("feature not available");
}

monitorUDT's send Rate Mbps and recv Rate Mbps: always return 0

System.out.println( "send Rate Mbps:"+monitorUDT.mbpsSendRate());
System.out.println( "recv Rate Mbps:"+monitorUDT.mbpsReceiveRate());

i call this method after i send data or recv data from an socket channel
but it just return 0,were these method haven't implemented?
thanks

NoSuchFieldError on Java 7u21

Hi,
It seems like the same issue that was fixed here: #35
came up again on newest Java release.

java.lang.NoSuchFieldError: address
at com.barchart.udt.SocketUDT.initClass0(Native Method)
at com.barchart.udt.SocketUDT.(SocketUDT.java:142)
at transmission.FileReceiver.createSocket(Unknown Source)
at transmission.FileReceiver.run(Unknown Source)

switch to TDM-GCC

Would it be possible to switch to the TDM-GCC toolchain for Windows. Should make other users lives easier since it's a single toolchain which can compile both 64/32 bit windows programs using -m32 and -m64 respectively.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.