Flex & nginx : Channel.Call.Failed - apache-flex

I created a web application, here is the architecture :
Tomcat7 deploy on Amazon EC2
Granite DS
nginx to redirect HTTPS throught the tomct7 port 8181
Flex application that uses RemoteObject on a secure Channel.
Occasionaly, maybye when a request takes to long time, the execution of a RemoteObject in Flex triggers this error :
faultCode:Channel.Call.Failed faultString:'error' faultDetail:'NetConnection.Call.Failed: HTTP: Status 504'
But in the most time, the response of the Remote object is correct.
Could you tell me if Nginx could block something? Or if BlazeDs has a tomeout?Any clues?
Thank you very much

We've had this issue for a long time...problem is we haven't been able to find a repeatable way to force it to disconnect.
Here the most comprehensive list of things to try that i've been able to find:
http://www.bopit.in.th/2009/10/14/flex-channel-connect-failed-error-netconnection-call-failed-http-status-200/
We've tried a couple of those solutions and it seems like we're getting less client disconnects.
There also may be a problem with AVG's linkscanner hijacking the request as it leaves the browser, and then losing it somewhere. We had one machine in our shop that would disconnect when using IE, and since uninstalling AVG, it's never happened on that machine again.
another thing you could check is the socket timeout:
NetConnection.Call.Failed happening sporadically in Flex3/Tomcat/BlazeDS/Spring
and here is a thread on adobe forum about the issue:
http://forums.adobe.com/thread/552133

Related

Blazor Server # of connections per use is limited by the browser

I am in the process of building a Blazor Server-Side database application.
One of my requirements is that the user can open each website page in a different tab.
I have found that after 5 tabs are opened, any new pages are blocked from rendering. If I close one page, then the 6th page can render. Apparently this is due to the fact that browsers can support a limited number of SignalR connections at one time. I have read the limit for Chrome is 6 at a time (although I can only get 5 working).
Error Messages in Chrome:
Error: Connection disconnected with error 'Error: Server returned handshake error: Handshake was canceled.'
Error: Error: Server returned handshake error: Handshake was canceled.
Uncaught (in promise) Error: Cannot send data if the connection is not in the 'Connected' State.
at e.send (blazor.server.js:1)
Is there a solution for this problem? Or do I need to explore porting to Blazor Client?
I found the following article about this topic but not sure it it can be applied to a Blazor application:
SignalR and Browser Connection limit
It's a little scary as I have already built quite a bit of code, and don't want to spend too much time trying to hack a workaround.
I finally managed to replicate it on my internal network, it seems to have been resolved now that I have installed WebSockets.
Open Server Manager
Open Add Roles and Features
Expand WebServer (IIS)
Expand Application Development
Select WebSocket Protocol
After installing this, I opened 20 tabs of my blazor server application, each one on a different page and the issue did not re-occur (I also did a couple of refreshes on each to be sure).
I came across this after reading
Blazor works best when using WebSockets as the SignalR transport due to lower latency, reliability, and security. Long Polling is used by SignalR when WebSockets isn't available or when the app is explicitly configured to use Long Polling.
From the Blazor docs.

TCP Connection in Web application

I really need your advice on this.
I have many TCP Client Devices. The Web application is going to be accessed by many users after an authentication.
The problem I need to solve is -
Create a TCP Listener for these client machines and that should be accessed by every user -
Solution I think - create a tcp connection on a page. Every user will create a new tcp connection from their device(local host) once the page is load . This is possible because every user pc is diferent so its going to be entirely different connection. But this solution is not going with problem 2.
The Machine broadcasts data every 30 seconds. So my application should be able to catch that data and update on the page.
This is I think is the main problem.
I know live data update on a web page can be done using SignalR. But SignalR does not connect with TCP Client machine directly. So what I was trying to do is -
1st - I tried making a WCF Service for TCP listener. WCF service will get data from machine and save into database from where signalR will do its job. But Whenever I am using wcf service my system is getting hang. So I dont know if its a right way to do that.
2nd - I tried creating Windows service as tcp listener. But I dont think its gonna work with web application.
To be very frank, I am not able to understand what should I do for this functionality.
From my side - I just want a TCP connection on application level that should be persistent, independent of user and should not close on any page reload.
Whenever that connection receives data it should be updated on every user's web browser without any reload.
I cannot use timer. It should be realtime.
According to what I found and understood, TCP connection is with a device so signalR can not be used directly. We need something else(like a service) in between to make it work with signalR.
So at the end, What should I do?
I hope I am clear enough to state my problem.
I just want to discuss so that my doubts can get clear and I may find the desired result at the end.
EDIT 1 :
In websocket, signalR... normally client refers to web browser.
Can a device(Multimedia control device) be a client similar to web browser for signalR?

Spring websocket working on local tomcat but not in server

I have a Spring mvc application, and I'm using websockets to communicate a phisical device that sends data with an angular 2 front end.
the architecture is like this
device ----> Spring Mvc <-----angular 2 front end
I have a datasource listener that publish to a websocket topic everytime a new message appears and I consume that topic from angular.
My problem is that this is working properly in my local tomcat install but when I upload it to a faster server it doesn't.
The main problem I'm having is that is buffering the messages and is reaching the limit and closing the websocket session.
What I noticed checking the logs is that in my local server messages come 20 milliseconds after last one is finished but in the other server sometimes are coming at the same time and they are being buffered throwing the session limit exception.
I tried setting a higher buffer size.
Also tried a thread.sleep but it doesn't worked.
Do you have some ideas what can I do ? should I implement some kind of message queue ?
Thanks in advance

ASP.NET ScriptManager-based AJAX calls to web service failing

We have a gaming application in which clients, all running IE make calls to web services using the API generated by the ASP.NET ScriptManager.
After a certain period of time, we start getting failures, with Fiddler showing the following error coming back from the server:
Connection to xxx.yyy.net failed.Exception Text: Only one usage of each socket address (protocol/network address/port) is normally permitted
We are not in control of the server's hardware, so altering the TCP/IP settings is not an easy option. Anyone have thoughts on how to deal with this?
This blog post seems relevant.
"Here is the scoop 1. When you make authenticated calls, the client is closing connections. And when you are making authenticated calls repeatedly to the same server, you are making and closing connections repeatedly 2. The same might happen when you are making regular http [un authenticated] calls but setting keep-alive = false."
http://blogs.msdn.com/b/dgorti/archive/2005/09/18/470766.aspx

Random "Connection reset" error when calling 2 or more RemoteObject function

I know this question is something difficult to resolve, but I have been walking thourgh sources, googling, etc... and haven't found anything clear bout the problem I'm going to expose.
I have an application that uses php as backend. I use amf as my transport protocol. The problem is that when I do some requests to the server backends through remote objects, randomly, I recive a connection reset on all/several requests. This does not happen when just one remote service request is made, or at least it didn't happen to me. Problem is more visible as more concurrent calls are execute at once.
Could anybody guess what is hapenning from this little info? At first I thougt it was an Apache problem that reset the connection because of a bunch of requests, but I have following requests and I do 3 or 4 concurrect requests, not more.
Thanks in advance for your time.

Resources