Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-Blocking SocketChannelUDT write overflow error print #72

Open
kofcredif opened this issue Oct 31, 2014 · 2 comments
Open

Non-Blocking SocketChannelUDT write overflow error print #72

kofcredif opened this issue Oct 31, 2014 · 2 comments

Comments

@kofcredif
Copy link

[maven]

com.barchart.udt
barchart-udt-bundle
2.3.0

[uses]
SelectorProviderUDT.STREAM.openSocketChannel()
SocketChannel.configureBlocking(false);
SocketChannel.write(buffer);
[problem]
unexpected error message printed out to screen when transport huge data by split 1024bytes
message : 'send: Non-blocking call failure: no buffer available for sending'
my application is console(terminal) application then i hope avoid this message to be printed

[trace]
SocketChannel.write() => SocketUDT.write() => SocketUDT.send() => static native SocketUDT.send1() => api.cpp/CUDT::send((UDTSOCKET u, const char* buf, int len, int)
=> core.cpp/CUDT::send(const char* data, int len)
=> if (m_iSndBufSize <= m_pSndBuffer->getCurrBufSize())
{
if (!m_bSynSending)
throw CUDTException(6, 1, 0);
=> common.cpp/CUDTException::getErrorMessage()
=> case 6:
m_strMsg = "Non-blocking call failure";

    switch (m_iMinor)
    {
    case 1:
       m_strMsg += ": no buffer available for sending";
       break;

[help me]
how can I avoid this error? or is there any way to check UDT buffer space enough?
or disable error message...
at least i want way to get m_iSndBufSize and m_pSndBuffer->getCurrBufSize() at barchart-udt

please help. thank you

@kofcredif
Copy link
Author

com_barchart_udt_SocketUDT.cpp/Java_com_barchart_udt_SocketUDT_send1()
=>
case SOCK_STREAM:
int ss;
while (ssize < size) {
if (UDT::ERROR
== (ss = UDT::send(socketID, (char*) (data + ssize),
size - ssize, 0))) {
printf("send: %s\n", UDT::getlasterror().getErrorMessage()); <- I need to disable this error printing
ssize = ss;
break;
}
ssize += ss;
}
rv = ssize;
break;

@kofcredif
Copy link
Author

i try compile udt and barchart jni but failed to link udt.dll to jni because error 'undefined reference to __im__ZNxxx'
there isn't way to merge msvc dll and g++ or convert dll to .a
-dlltool could not create .a containing dll, .a just offer to interface to use dll from mingw

[solution]

  1. modify code conflict pthread...
  2. make dllimport define to empty from udt.h
  3. compile barchart jni with udt source(not compile udt.dll)
    -use compile option : barchart-udt-core/aol.properties

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant