Auto reconnection to TibcoEMS servers - c#

Do I need to implement anything to enable the "retry to connect" or "failover to another server"? From what I understand, these two should be taken care of as long as I configure them correctly (aka a fault-tolerant connection url and ReconnAttemptCount, etc.) However, it doesn't work for me.
My current scenario is that my app successfully connects to the EMS server, it can receive and send msg. Then I disable network connection, I can see exception "TIBCO.EMS.EMSException: Connection has been terminated" is thrown. Enable network connection but the connection to EMS server does not automatically restore.
Please help to advise. If my understand is wrong, please help to correct me as I am very new in this area.

Related

SignalR WebSocket Closed with status code 1006 (no reason given) (only on the remote server after deployment)

I'm working with a project which combines angular app on a client-side and .net core 6 web API app on the server-side. To provide real-time communication between client and server on different browsers without reloading the page I use SignalR (with custom hubs of course) to track connections' Ids and send data to specific clients by connections' Ids which is stored in SQL server database after client connection and removed after client disconnection. On my local environment all works fine, but after deployment on hosting a websocket problem happened. On the first screenshot u can see no errors in my browser console in a couple of minutes after client connection and some data manipulations between client and server through hubs. On the second screenshot u can see the result of this data-manipulations between client and server but on the remote hosting server. I'm so confused about it, because this error happened only on remote server, locally websocket transfer type works as it expected.
Is it a hosting server error which needs to be resolved by hosting provider? Or this is my mistake?
I think there is a lot of questions with the same subject on the stack overflow, but I was searching for the right answer which can be a good solution for my problem, but... I can't find anything which can help me. Feel free to ask more info about signalR implementation if it needs to help me in this situation. Thanks!

How to check whether IP address is reachable or not using C#

I am validating whether the given IP is reachable or not. In server PING, TELNET, etc options are disabled.
I tried with Socket Connection but this needs the given PORT to be allowed.
Is there any reliable solution to check this. It should work on all the environment [independent of OS]
Please guide me to implement this on C#
There is no such thing as "IP address is reachable" in general. Relevant is, if a specific service on a server can be successfully contacted - because at the end one wants to use the server for a specific purpose. Checking if one can ping the server says nothing about this: it might be that ping is disabled or blocked but that the server can still be reached by HTTP (i.e. web). Similar it might be that ping works but HTTP will not work either because there is no HTTP service running at the server or because some firewall in between is blocking access to HTTP for all or even only for specific clients.
Thus, you have to decide what you really want to know, i.e. what you want to achieve with the knowledge of the IP being reachable. For example if you want to use this knowledge to access the web server there later you should try a connection at port 80 (default port for HTTP).

Data Power Connectivity Errors

All
At times, when sending a request to our web service DataPower sends failure alerts wit the below error codes/messages
0x01130006: Failed to establish a backside connection
0x01130011: Failed to process response headers
I am not sure why this is happening, but I would guess the request is too big to process by DataPower, times out, and sends failure messages to the application.
I found a forum suggesting to increase the thread count max on the Websphere servers, but it was never confirmed to be a working [or non working] solution.
I would like to know if someone has successfully resolved this issue with the above mentioned solution, or what other successful solutions are there.
Thanks
Might be that someone trying to reach not excited uri .
The error say faild established backside connection.
There could be several reasons for it namly,
1. You have conflicting routing information in datapower routing table about back end systems. In this case appliance will sometimes able to connect with backend and sometimes not.
2. The backend server is not able to respond in appropriate time [try to increase the 'back side timeout value].
To accuratly debug the issue you need to post the packet trace between datapower and backend systems [along with src and target IPs you are connecting to].
Are you also using load balancer on datapower to connect with backend?
Ajitabh

ConnectionLinkFailed on GPRS connection

I'm using this sample code by CodeProject to connect to GPRS in a Windows Mobile in C#.
I tried the code and it works fine. However, sometimes I get a message saying "ConnectionLinkFailed" and I can't connect to GPRS.
I must wait some time in order to being able to connect again. Rebooting doesn't solve the problem either.
Does anyone knows how to avoid this exception?
Thanks for any help!
The MSDN site only states:
CONNMGR_STATUS_CONNECTIONLINKFAILED The connection link was prematurely disconnected.
There is no further description. I assume you have a problem with your provider. Beside from that, I do not rely on Connection Manager (CM) connections. Soemtimes it states a connection is available, but it is not in real as CM uses a cached information.
Normally, for getting a connection, you only have to issue a http request. CM will choose the right connection. Usa of CM API is only usefull if you need to switch between different connections with same destination network. But this i normally not the case, as you will have normally only a WiFi and one GPRS connection to internet and WiFi is selected prior to GPRS (due to costs).
What is the scenario that makes you think you have to use CM?

Permanent TCP connection or connection etablishment at request processing

I am developing a TCP server, which shall communicate with the client, if specified tasks are finished. So I open on the server a socket and the client connects on it.
That connection can be used for data tranfers back to the client, too. That is quite okay.
But what about connection aborts and anything like that?
My thought was to connect each time to the server, when the client have to communicate with it. But how can I send data back to the client?
Shall I open a socket on the client side, too?
EDIT:
I have considered WCF, too. I think it could be a very good way to implements server client hierarchy.
What do you think?
It depends on the rest of your requirements. If we're talking a message that is in no rush that might be sent once a day, the right solution might be for the client to connect to the server periodically and check if there are any messages. If we're talking something that's more common and more in a rush, the right solution might be for the client to keep a connection open to the server at all times. In some cases, the right solution might be for the server to make a 'backwards' connection to the client, if possible -- perhaps with an option to fall back to a persistent connection from the client to the server if the 'backwards' connection isn't possible.
See this article on Push technology, particularly the section on long polling.
From a runtime POV having the server connect to the client needs a network environment supporting this (firewall/IDS etc.).
IF you can't be sure that this is always the case then this option is ruled out IMO.
As for the client keeping the connection open:
I think this is a good option... you need to make sure that the client implementation detects any connection problems and automatically reconnects...
Whatever solution you implement you might need to implement a queue of events per client... depending on your requeirements these queues might even need to be persistent...
WCF can work in all the ways I described and offers several things (like serialization, optional session management, transport security etc.) which help build a robust and well-maintainable system... although a pure TCP/IP-based solution might be better performance-wise...

Categories