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

Socket closed, when state "Connected" #59

Open
GodFuper opened this issue Nov 7, 2024 · 1 comment
Open

Socket closed, when state "Connected" #59

GodFuper opened this issue Nov 7, 2024 · 1 comment

Comments

@GodFuper
Copy link
Contributor

GodFuper commented Nov 7, 2024

The game shows that there is no connection with the player. Ice Debug shows that there is a connection (state = 'Connection'). The logs say that the Socket is closed.

2024-11-07 04:04:29.825 DEBUG Error while reading from local FA as peer (probably disconnecting from peer) Hann(375817) (com.faforever.iceadapter.ice.Peer:84)
java.net.SocketException: Socket closed
	at java.base/sun.nio.ch.DatagramSocketAdaptor.receive(DatagramSocketAdaptor.java:264)
	at java.base/java.net.DatagramSocket.receive(DatagramSocket.java:714)
	at com.faforever.iceadapter.ice.Peer.faListener(Peer.java:81)
	at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.nio.channels.AsynchronousCloseException: null
	at java.base/sun.nio.ch.DatagramChannelImpl.endRead(DatagramChannelImpl.java:564)
	at java.base/sun.nio.ch.DatagramChannelImpl.trustedBlockingReceive(DatagramChannelImpl.java:718)
	at java.base/sun.nio.ch.DatagramChannelImpl.blockingReceive(DatagramChannelImpl.java:675)
	at java.base/sun.nio.ch.DatagramSocketAdaptor.receive(DatagramSocketAdaptor.java:241)
	... 3 common frames omitted

try {
DatagramPacket packet = new DatagramPacket(data, data.length);
faSocket.receive(packet);
ice.onFaDataReceived(data, packet.getLength());
} catch (IOException e) {
log.debug("Error while reading from local FA as peer (probably disconnecting from peer) " + getPeerIdentifier(), e);
return;
}

2024-11-07 04:00:52.724 WARN  ICE Hann(375817): Error while reading from ICE adapter (c.f.iceadapter.ice.PeerIceModule:413)
org.ice4j.socket.SocketClosedException: Socket closed
	at org.ice4j.socket.MergingDatagramSocket.receive(MergingDatagramSocket.java:491)
	at org.ice4j.socket.DelegatingDatagramSocket.receive(DelegatingDatagramSocket.java:698)
	at org.ice4j.socket.SafeCloseDatagramSocket.receive(SafeCloseDatagramSocket.java:173)
	at org.ice4j.socket.MultiplexingDatagramSocket.multiplexingXXXSocketSupportDoReceive(MultiplexingDatagramSocket.java:414)
	at org.ice4j.socket.MultiplexingDatagramSocket$1.doReceive(MultiplexingDatagramSocket.java:66)
	at org.ice4j.socket.MultiplexingXXXSocketSupport.receive(MultiplexingXXXSocketSupport.java:649)
	at org.ice4j.socket.MultiplexingDatagramSocket.receive(MultiplexingDatagramSocket.java:465)
	at com.faforever.iceadapter.ice.PeerIceModule.listener(PeerIceModule.java:392)
	at java.base/java.lang.Thread.run(Thread.java:1583)

try {
DatagramPacket packet = new DatagramPacket(data, data.length);
localComponent.getSelectedPair().getIceSocketWrapper().getUDPSocket().receive(packet);
if (packet.getLength() == 0) {
continue;
}
if (data[0] == 'd') {
//Received data
peer.onIceDataReceived(data, 1, packet.getLength() - 1);
} else if (data[0] == 'e') {
//Received echo req/res
if (peer.isLocalOffer()) {
connectivityChecker.echoReceived(data, 0, packet.getLength());
} else {
sendViaIce(data, 0, packet.getLength());//Turn around, send echo back
}
} else {
log.warn(getLogPrefix() + "Received invalid packet, first byte: 0x{}, length: {}", data[0], packet.getLength());
}
} catch (IOException e) {//TODO: nullpointer from localComponent.xxxx????
log.warn(getLogPrefix() + "Error while reading from ICE adapter", e);
if(component == localComponent) {
onConnectionLost();
}
return;
}

@GodFuper
Copy link
Contributor Author

GodFuper commented Nov 7, 2024

ice-adapter-copy.log

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