@Erel ,
Following discussion on my "PowerPoint Mouse", and even if I admit that I should "reverse" the client/server sides to have a wider chance of success with firewall issues, I still have a problem with my very secured business PC...
Let's asssume that my PC ONLY accepts one fixed port both for incoming and outgoing TCP.
What I would need is to force the local port (on my device) to this fixed value so that it is seen from my PC as "allowed".
A network guy told me that I could achieve this using socket "bind". I have searched on the net and found something which could be usefull.
My questions are :
1) how could I access this method in B4A ?
2) if I "bind" to a local port could I also "connect" to a remote host address and port ?
For further explaination here is the log of my firewal (extract)
Message : blocked incoming TCP - Source 192.168.43.1 : (37968) Destination 192.168.43.251 : (5500)
the source address is my device IP given when in wifi hotspot mode
37968 is the local port number given "at random ?" when connecting to the socket
destination IP is the PC server address connected to my device (hotspot) and 5500 is the allowed port
I just want to force the "37968" port number to 5500 to give a chance to the packet to enter the PC !
Thanks
Following discussion on my "PowerPoint Mouse", and even if I admit that I should "reverse" the client/server sides to have a wider chance of success with firewall issues, I still have a problem with my very secured business PC...
Let's asssume that my PC ONLY accepts one fixed port both for incoming and outgoing TCP.
What I would need is to force the local port (on my device) to this fixed value so that it is seen from my PC as "allowed".
A network guy told me that I could achieve this using socket "bind". I have searched on the net and found something which could be usefull.
B4X:
public void bind (SocketAddress localAddr)
Added in API level 1
Binds this socket to the given local host address and port specified by the SocketAddress localAddr. If localAddr is set to null, this socket will be bound to an available local address on any free port.
Parameters
localAddr the specific address and port on the local machine to bind to.
Throws
IllegalArgumentException if the given SocketAddress is invalid or not supported.
IOException if the socket is already bound or an error occurs while binding.
My questions are :
1) how could I access this method in B4A ?
2) if I "bind" to a local port could I also "connect" to a remote host address and port ?
For further explaination here is the log of my firewal (extract)
Message : blocked incoming TCP - Source 192.168.43.1 : (37968) Destination 192.168.43.251 : (5500)
the source address is my device IP given when in wifi hotspot mode
37968 is the local port number given "at random ?" when connecting to the socket
destination IP is the PC server address connected to my device (hotspot) and 5500 is the allowed port
I just want to force the "37968" port number to 5500 to give a chance to the packet to enter the PC !
Thanks