DAPI icon indicating copy to clipboard operation
DAPI copied to clipboard

Creating UDP connection without then initiating TCP connection causes DAPI to freeze

Open Daverinoe opened this issue 1 year ago • 2 comments

I'm currently trying to write my own frontend to interact with the DAPI server, and I can now successfully initiate a connection with DAPI.

However this then causes DAPI to freeze. This means that every change I make while implementing this feature, I have to close Diablo, reopen, re-inject DAPI.

Overall this is just an annoying thing, but perhaps in this section of DapiProtoClient::checkForConnection() line 56:

    tcpListener.accept(tcpSocket);

I think it just needs a value in the timeout parameter.

Daverinoe avatar Dec 05 '24 20:12 Daverinoe

Yeah, no, I was totally out of my mind last night.

Don't know how I managed to look at tcpSocket instead of tcpListener.

I thought it would be as simple as adding

tcpListener.setBlocking(false);

I compiled this and tested, and the example client never seemed to connect.

Daverinoe avatar Dec 06 '24 07:12 Daverinoe

I think it just needs a value in the timeout parameter.

That's on the connect function, the line you called out is the accept function. From what I can see, the accept function has no additional optional parameters. That said, it does hang if the UDP ping works but the TCP connection fails to establish that feels like there should be a way to avoid it; however, I'm not sure what the right approach would be.

NiteKat avatar Dec 08 '24 00:12 NiteKat