Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[dsdp-tcf-dev] Handling errors when opening a channel

Title: Handling errors when opening a channel
I’d appreciate some advice on how to handle errors when opening a channel. I’m calling IPeer.openChannel but in this case the peer has shutdown and is no longer available.

java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at org.eclipse.tm.tcf.core.ChannelTCP$1.run(ChannelTCP.java:70)

I’ve installed a ChannelOpenListener but that only tells you when it has been opened, not when something goes wrong. I’m looking for the best place to detect this. It looks like the channel gets terminated but I’m not sure how to listen for that.

Thanks - Ken

Back to the top