TCP connections - max users

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
Monzan
Posts: 3
Joined: Fri Jul 20, 2012 12:28 pm
Location: Sweden

TCP connections - max users

Post by Monzan »

Hello.

I'm new to HMI programming and I have a problem.

I have programmed an Android application for controlling motors that move tables in a greenhouse.

I am using the built-in webserver in a T7A panel to control tags.

It works quite good but I have a problem that it seems that when a connection disconnects from the android pad, it does not seem to do a graceful shutdown.
That will cause the server will be full and I have to wait for the connections to timeout.

I'm using DefaultHttpClient to enable a connection to the panels webserver.

So I want to is what can i do to fix this problem. Off coarse can my problem be in my Android code.

I have a few ideas on how to fix this, so my question is what can or should i do.
  • Increase no. of allowed connection from 2 to maybe 10. - Easiest solution for me.
  • Decrease the timeout time for the connection to a value that make in useful.
  • Make a script that disconnects all tcp-connections set to a timer.
  • Maybe writing a udp client-server scenario.
  • Create a proxy that the android communicate with. Android -> Proxy -> Panel
I'm hoping for any tips.

//Monzan

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: TCP connections - max users

Post by mark.monroe »

Version 2.0.463 of iX Developer only allows two concurrent connections. There is currently no way to increase it in software. Normally two connections is enough if you are connecting to the unit with one device. Open connections will timeout after a while, and can be used again.
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

Monzan
Posts: 3
Joined: Fri Jul 20, 2012 12:28 pm
Location: Sweden

Re: TCP connections - max users

Post by Monzan »

Hi thanks for replying.

The thing is that 2 connection isn't enough.

During a normal day the pad will fill up both connection with non usable connections. For instance if the pad goes into sleep mode the connection seems to get destroyed and it connects again. (This might off coarse be were some of the problem lye's.)

What this means is that some times when i want to do something i get a error 503 (server full), and it takes about 10-20 min to the connection to timeout.

So if there isn't a mean of increasing the number of allowed connection through a custom firmware or something. I might need the panel to actively disconnect tcp connection on a regular basis to flush the connections.

I've not much experience in coding C# and i don't know where to get a doc listing over the different api's in the library that is in the panel. So i can create a connection flusher.

//Monzan

Post Reply