The different isolate communicate with each other by the port, does the port is the socket's port, use the socket send and receive message from each other?
Related
I have an Azure Container App running and is listening on a public TCP port 8000 (via the load balancer) for incoming connections. When incoming connections are arriving, I serve them with data and everything goes as expected.
My problem is when I stop the server listening on that port. In that case, a client application trying to connect to my public IP address at port 8000 would expect to get an error like 'Could not connect' but this is not happening. What is in fact happening is that the Container Apps environment seem to be forwarding the data no mater what to that port (even if there is no server listening). As such, the client connecting to that port can't understand that the server that should be listening to that port is really stopped (in order to resend the data at a later time).
Example:
Open a TCP client (eg. PacketSender) and try to send some data to port 6000 on your localhost. You should receive a 'Could not connect' error message.
Now, in docker run the following:
docker run -p 6000:6000 nginxdemos/hello:plain-text
Try again to send some data to port 6000 via a TCP client. This time the data will be sent even though the nginxdemos container doesn't listen to port 6000 (but probably on 80).
Is it any way that I can somehow solve that issue on the server side and ensure that the clients can't connect if the server is stopped? I have devices sending thousands of data on a Container App but because they do not expect any kind of an ACK, they think that the data have been transmitted (even though they haven't) and they don't try to resend them.
Not sure about the docker example, it probably depends on how docker on that system implements port forwarding.
In Azure ContainerApps: no, this is not possible. There is always some component listening on the port, even if your application is not running or is restarting, provisioning, scaling, etc. The connection will be buffered until the app starts listening on the port or it times out.
I'm trying to establish a connection with a diameter server. That server has a restriction parameter of "peer port"
Which means source port of my outgoing traffic should be restricted to a specific port.
Since I'm using an erlang diameter client, I didn't find any parameter to specify the outgoing port. It will initiate the connection with a random port to the destination ip:port.
Is there a way to translate my outgoing traffic to that ip locally to a specific port from linux?, so that the external server will see my source port as the allowed port.
You should apply a NAT at the sender side. Read this thread, it explains how to do it with iptables.
I have problem connecting server that is in internal network(e.g wifi network).Im using rad studio idtcpclient
IdTcpClient1.Host:='ip'
IdTcpClient1.Connect;
But with what I need replace ip to connect this server?
If the client is inside the same WiFi network as the server, the client can connect to the server's LAN IP address directly.
If the client is outside of the WiFi network, the client cannot connect to the server's LAN IP address directly. It must connect to the WiFi router's public WAN IP instead, and the router must be configured with port forwarding enabled to pass inbound connections to the server. If the router supports uPNP, the server app can dynamically create port forwarding rules for itself, otherwise the router admin must configure them manually.
When from machine A, you do a telnet to machine B, you specify ip and port of B.
But what is the port on A from which the request originates? Does it pick any random port that is free?
Telnet runs on top of TCP. TCP clients use ephemeral ports. Most OSes allocate a special range of ports for this use, and when a new connection is to be opened, they select an arbitrary available port. See https://en.wikipedia.org/wiki/Ephemeral_port for more information.
In RMI the server opens the registry on some port and then the clients connects to the server. Is there any way knowing on which port the connection is made between the server and the client?
I know the default port for RMI is 1099 but what is the port number on the client side? Does the client even opens a port?
The client does have a local port, as in any TCP connection, but there is no way for the server to discover it short of a custom socket factory.
There's also no reason for the server to need it. It's not a useful piece of information. It's not a listening port, so you can't connect to it; it changes from time to time; and it doesn't uniquely identify the client, because of client-side connection pooling and server-side idle connection timeouts.