A clear and concise description of what the bug is.
According to the Java documentation of ServerSocket ( https://docs.oracle.com/javase/7/docs/api/java/net/ServerSocket.html#ServerSocket(int,%20int,%20java.net.InetAddress) )
if you provide 0 for the port number a port will be automatically allocated. That part works correctly in react-native-tcp-socket, but the 'connect' callback reports the port to be 0, when in fact that is not the actual port it's listening on. It should get the port number after the ServerSocket instance is created by calling getLocalPort.
This works correctly on iOS.
Current behavior
Port is reported as 0 when the port passed to tcpServer.listen is 0.
Description
A clear and concise description of what the bug is.
According to the Java documentation of ServerSocket ( https://docs.oracle.com/javase/7/docs/api/java/net/ServerSocket.html#ServerSocket(int,%20int,%20java.net.InetAddress) ) if you provide 0 for the port number a port will be automatically allocated. That part works correctly in react-native-tcp-socket, but the 'connect' callback reports the port to be 0, when in fact that is not the actual port it's listening on. It should get the port number after the ServerSocket instance is created by calling
getLocalPort
.This works correctly on iOS.
Current behavior
Port is reported as 0 when the port passed to tcpServer.listen is 0.
Expected behavior
The actual port number should be returned.
Relevant information