How to connect with application server? - express

I have 3 application servers running on 3 different ports doing the same thing. I want a socket connection between the client and a free application server. How to pass the information of the free server's port number so I can achieve a socket connection. Should I give the client the port number of the free application server?
Currently I am giving the client the port information and achieving a socket connection with the app server.
I am very new to web development and please forgive me for my poor English.

Related

Port change every Time OPC restart

I have Nifi server connected to an OPC server to retrieve Data and send it to Kafka , the problem I have is that every time OPC server restart the port between Nifi and The OPC change and I loose connection , so I have to determine the new port and ask security team to open the New Port , is there any way to fix this Problem in Nifi ? or it should be fixed in the OPC server ?
What you explain seems normal.
When a client connects to a server normally the client's operating system assigns a random port number to the client's connection, that is normal, the one that is fixed is the port on which the server listens.
If the server reboots you will always lose the connection and the client will have to reconnect ... with a different port number
The solution is that the client tries to reconnect automatically if the connection is lost

VB.NET Server Does Not Receive Connection Requests from Remote Clients

VB.NET Server Does Not Receive Connection Requests from Remote Clients
A VB.NET server application does not see connection requests from another client on the network (i.e. with a different IP address). However, it does see connection requests from the client application running on the same computer as the server.
The listening socket is created with the following parameters
System.Net.Sockets.AddressFamily.InterNetwork
System.Net.Sockets.SocketType.Stream
System.Net.Sockets.ProtocolType.IP
We have experimented with the preceding without success.
The endpoint to which the listening socket is bound specifies the local IP address and a specific port number.
The wait-for-connection code is textbook asynchronous:
thelistener.Listen(10)
thelistener.BeginAccept(New System.AsyncCallback(AddressOf targetofaccept), thelistener)
If the client that attempts connection is on the same computer as the listener, then targetofaccept is run successfully. If the client that attempts connection is on some other computer on the network, then targetofaccept is not run.
The behavior occurs for any other client on the network (i.e., not just one).
Thinking that there was some firewall issue, we created VB6 servers and clients using the same addresses and ports. The VB6 server will receive connection requests regardless of the client system.
There is no other issue with communication between clients and the server, as far as we can see. The network architecture has not been modified for a number of years.
We are debugging the code as a VB.NET console application.
Any tips on how to diagnose appreciated.
Before calling Listen() you need to bind your listener socket to the address 0.0.0.0 (in .NET IPAddress.Any) so that it listens to connections from any IP address.
This can be done using the Socket.Bind() method:
Dim listenerEndpoint As New IPEndPoint(IPAddress.Any, <your port>)
thelistener.Bind(listenerEndpoint)
thelistener.Listen(10)
Thank you.
Issue WAS firewall. Fixed by finding exact location of the IDE (devenv.exe), opening "Windows Firewall" in the control panel, selecting "Allow a program or feature through firewall", selecting "Allow another program...", browsing to the exact location and selecting the executable, then ensuring "Home/Work (Private)" column is checked for that "Name".

How to connect db from local machine that can only be connected from windows remote desktop

The question says it all. But to elaborate.
I have a oracle db running at some remote host. ip: 10.0.0.121 port: 1521
It can be accessed when I connect to a windows remote desktop machine.
Now how can I connect to this remote db from my local machine?
I believe that localtunnel is similar to telebit in that you get an encrypted https connection, not a plain tcp connection (which is good).
If I understand correctly, you'll want to use localtunnel (or telebit or perhaps even ngrok) on the windows machine to expose its database connection to the outside world. You'll want to use https (and absolutely not tcp or http which would leak database passwords and all your data) to create the tunnel.
Then you'll need to run something like sclient (or stunnel) on the computer that's doing the connecting to "unwrap" the https connection back to plain tcp. It might look like this:
sclient example.localtunnel.me:443 localhost:1521
In your database client or application you would then use localhost:1521 in your database connection string (not the https address).
This gives you the security of an encrypted connection and the convenience of exposing ports out to the world, all without adding any complexity to your application or client - you just run it as normal, connecting to localhost.
Comment if you need any additional clarification.

SSL handshake failure Server [FIN, ACK] after Client Hello

Our company currently have an application created in VB6 running on a Windows 7 desktop computer. This application needs to connect to a web service using HTTPS.
For some reason this application can not connect to the target server. The target server is behind an Apache web server that also acts as a load balancer.
I traced the connection via wire shark and it seems that after the Client Hello the server responded with [FIN, ACK] than a Server Hello. Can anyone tell me what the problem is.
Client Hello & Server [FIN, ACK]
[![Client HEllo][1]][1]
[1]: https://i.stack.imgur.com/btXyX.jpg
[![enter image description here][2]][2]
[2]: https://i.stack.imgur.com/O5WDq.jpg
However, we can connect successfully in the following scenarios
If we use the same application under Windows 10. Please note when using Windows 10 our SSL version is TLS1.2.
If the application connect directly to the Application Server instead of the Apache Web Server. In this case our SSL protocol is still TLS1.0
I am guessing that we need to configure the Web Server to allow our application to connect. Our Administrator told us they already activated the TLS1.0 protocols so I am not entirely sure what is wrong now.
Why the server closed the connection, or any ideas what part of the logs or Web server configuration should I check to find out?
Please note that we are aware that we are using TLS1 protocol for this connection but this application is only for internal use and its replacement is already in development. However, there is a business need to make this work for the current environment.
In the case the Server doesn't support any of the Cipher-Suites suggested in the "Client Hello" packet, it may just close the connection.
You can check what is the returned Cipher-Suite in the case it works (when you use Windows10) and then investigate how to enable this Cipher-Suite in Windows7

Specify client port (and IP) on NetTcpBinding

Is it not possible to specify the local client port used for server calls via NetTcpBinding?
NetPeerTcpBinding support this - I find it hard to believe there's no way to specify the local port (and IP Address for that matter) on clients.
I need to be able to use port sharing and I can't do this if I don't know what port the client is listening on. I won't be able to share the port (and IP) with another client so it can connect.
The only work-around I found is something like this:
Client A opens a connection to Server
Server logs the IP and Port of Client A
Server shares this info. with
Client B
Client B should be able to
connect to Client A on specified IP
and Port (in theory)
This is known as TCP/IP NAT hole punching I believe. Anyone with experience in this?
You probably don't understand the communication pattern with NetTcpBinding. It works this way:
The client opens connection to the server
Two-way communication: The client calls the server and gets the response over the same connection.
Duplex communication: The client calls the server. The server stores reference to the channel somewhere (you must implement this). Once the server wants to notify client about anything it takes stored channel and calls the client on the connection established by the client during its first call.
The server never opens connection to the client. The client doesn't expose any address with port for incomming communication. If you want to do that you must implement service on the client in the same way you did it on the server and you must manully send the address and port to the service exposed by the server.
The difference with NetPeerTcpBinding is that there is no real server and any client must be able to get incomming request. NetTcpBinding is for client-server scenarios where the server is the only peer able to process incomming requests. Because of that only the server needs to define an address and a port.