barchart / barchart-udt

Java wrapper for native C++ UDT protocol.
https://github.com/barchart/barchart-udt/wiki
128 stars 89 forks source link

UDT Error : 2001 : connection was broken #65

Open andre77 opened 10 years ago

andre77 commented 10 years ago

Hi,

for some reason the udt library is throwing an exception, see below

SocketUDT socket = new SocketUDT(TypeUDT.STREAM);
socket.connect(new InetSocketAddress(host, port));

NetInputStreamUDT udtInput = new NetInputStreamUDT(socket);
NetOutputStreamUDT udtOutput = new NetOutputStreamUDT(socket);
final DataInputStream dis = new DataInputStream(udtInput);
final DataOutputStream dos = new DataOutputStream(udtOutput);

// the very first try to read the input stream
dis.readInt()

throws this exception

com.barchart.udt.ExceptionUDT: UDT Error : 2001 : connection was broken : recv/recvmsg [id: 0x2c2ba18e]
    at com.barchart.udt.SocketUDT.receive1(Native Method)
    at com.barchart.udt.SocketUDT.receive(SocketUDT.java:1183)
    at com.barchart.udt.net.NetInputStreamUDT.read(NetInputStreamUDT.java:83)
    at com.barchart.udt.net.NetInputStreamUDT.read(NetInputStreamUDT.java:74)
    at com.barchart.udt.net.NetInputStreamUDT.read(NetInputStreamUDT.java:63)
    at java.io.DataInputStream.readInt(DataInputStream.java:387)
    at ...

any ideas, what could be the reason?

sinlang commented 10 years ago

please use NetSocketUDT instead