Beijer Electronics (formerly QSI Corporation)
http://www.qsiforums.com/

[Solved] Upgraded libraries, connections no longer closing
http://www.qsiforums.com/viewtopic.php?f=6&t=4779
Page 1 of 1

Author:  UnknownBytes [ Fri Mar 14, 2014 4:27 am ]
Post subject:  [Solved] Upgraded libraries, connections no longer closing

Hello,

Hardware: QTERM-G55

I'm having issues with a library upgrade, specifically the DataProc library. The upgrade was from Qlarity Foundry 2.50 to Qlarity Foundry 2.63.

The specific error message I'm getting is "Transmission channel is in use". That tells me that the connections are not closing properly as before the error I have a function call which shuts down the connections. If I swap back to the old DataProc the connections properly close. It's on the new DataProc where the connections are not closing.

Here is the code in which the connections are being closed:

Code:
        while udp_msg_client_conn_state == true do
            udp_msg_client.closeConnection()
        loop
        udp_msg_client.enabled = false
        while udp_msg_server_conn_state == true do
            udp_msg_server.closeServerConnection()
        loop
        while udp_msg_server_conn_state_1 == true do
            udp_msg_server.closeConnection(udp_msg_server_conn)
        loop
        udp_msg_server.startconnection = false
        udp_msg_server.enabled = false
        while udp_client_conn_state == true do
            udp_client.closeConnection()
        loop
        udp_client.enabled = false
        while udp_server_conn_state == true do
            udp_server.closeServerConnection()
        loop
        while udp_server_conn_state_1 == true do
            udp_server.closeConnection(udp_server_conn)
        loop
        udp_server.enabled = false
        WebServer.closeServerConnection()
        WebServer.startconnection = false
        WebServer.enabled = false
        soap_main_client.closeConnection()
        soap_main_client.enabled = false
        netclose(soap_conn)


There are 4 objects being closed: udp_msg_server (EthernetServerV2), udp_msg_client(EthernetClientV2), soap_main_client(httpClientV2), and WebServer (EthernetClientV2).

I tried comparing the code of the closeServerConnection() and closeConnection() between the old and new DataProc library, but I didn't see any difference except for RemoveFromClientList() being added to the EthernetSeverV2 closeConnection() function. That has no effect on closing the connection so I'm at a lose at how to proceed from here.

edit: Solution
After more digging I was able to find the issue was with the FtpServerV2. There is an FTP server, which I didn't list initially as it is used in the software download for upgrades so it should not have been active and is only active when a download is to occur. This, however, wasn't the case. I had to modify the FtpServerV2 library to make it so the FTP server did not start on startup.

I can post the code if needed, but the general gist of it was stopping the FTP server from starting at startup and creating methods to start on-demand.


Thank you

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/