Hi,
It seems that the PCAN Ethernet GW DR automatically connects to our server application upon power on. However, when I quit the server application and restart it, there is no automatic reconnect from the PCAN. CAN messages from the CAN bus are apparently forwarded to the Ethernet side even if no connection is established but one or two telegrams are lost before the PCAN reconnects to the server application.
What would be the proper way of making sure that the PCAN reconnects if the connection is closed by the server? Does the PCAN notice that the server application is stopped?
Any help is much valued.
TCP connection from PCAN to server application
Re: TCP connection from PCAN to server application
Hi,
do you use a socket-based communication, a communication via the PEAK-LAN driver or directly via 2 Ethernet-Gateways?
regards
Gunther
do you use a socket-based communication, a communication via the PEAK-LAN driver or directly via 2 Ethernet-Gateways?
regards
Gunther
Re: TCP connection from PCAN to server application
Hi,
Many thanks for your response.
BTW, I am not aware of a 'lan driver'. Can it be freely downloaded from your website?
Looking forward to hearing from you.
Many thanks for your response.
We are using a plain socket connection from the PCAN to our server software.G.Lang wrote: do you use a socket-based communication, a communication via the PEAK-LAN driver or directly via 2 Ethernet-Gateways?
BTW, I am not aware of a 'lan driver'. Can it be freely downloaded from your website?
Looking forward to hearing from you.
Re: TCP connection from PCAN to server application
Hello,
please be sure that you are closing the socket before terminating your server. The socket on the PCAN Gateway side probably doesn't note the disconnection and that is why it not tries to reconnect.user1000 wrote:We are using a plain socket connection from the PCAN to our server software.
The PCAN-LAN driver and the "Virtual PCAN-Gateway" is a software solution that emulates a PCAN-Gateway in a computer, providing access to the CAN data using the PCAN-Environment (eg. using PCAN-View). This product is in BETA stadium. Selected customers receive this for evaluation.user1000 wrote:BTW, I am not aware of a 'lan driver'. Can it be freely downloaded from your website?
Best regards,
Keneth
Keneth
Re: TCP connection from PCAN to server application
Hi,
1 - My server app sends a FIN/ACK packet to the PCAN.
2 - The PCAN returns an ACK.
3 - My server app quits.
4 - My local socket is now in the state FIN-WAIT-2.
5 - The PCAN keeps sending TCP-Keep-Alives for another 60 secs each of which my local machine ACKs.
6 - After 60 secs, my machine sends an RST to the PCAN which is the last packet exchanged.
Thanks for your help.
I am on a Ubuntu machine. What happens when do a shutdown on the socket is:K.Wagner wrote: please be sure that you are closing the socket before terminating your server. The socket on the PCAN Gateway side probably doesn't note the disconnection and that is why it not tries to reconnect.
1 - My server app sends a FIN/ACK packet to the PCAN.
2 - The PCAN returns an ACK.
3 - My server app quits.
4 - My local socket is now in the state FIN-WAIT-2.
5 - The PCAN keeps sending TCP-Keep-Alives for another 60 secs each of which my local machine ACKs.
6 - After 60 secs, my machine sends an RST to the PCAN which is the last packet exchanged.
Thanks for your help.
Last edited by user1000 on Tue 13. Jan 2015, 09:43, edited 1 time in total.
Re: TCP connection from PCAN to server application
*** UPDATE ***
I just noticed that when I have two connections open,
A/TX: client app connecting to PCAN for sending data to PCAN
B/RX: server app accepting connections from PCAN for receiving data from PCAN,
A/TX is closed as expected: Client sends a FIN/ACK, PCAN responds with FIN/ACK but
B/RX is only "half-closed", as described in my previous post.
Thanks.
I just noticed that when I have two connections open,
A/TX: client app connecting to PCAN for sending data to PCAN
B/RX: server app accepting connections from PCAN for receiving data from PCAN,
A/TX is closed as expected: Client sends a FIN/ACK, PCAN responds with FIN/ACK but
B/RX is only "half-closed", as described in my previous post.
Thanks.
Last edited by user1000 on Tue 13. Jan 2015, 09:42, edited 1 time in total.
-
- Hardware Development
- Posts: 87
- Joined: Fri 10. Sep 2010, 13:11
Re: TCP connection from PCAN to server application
Hi,
ATM the reconnection is triggered by the first incoming CAN message on the CAN channel that belongs to the route. It seams as if this first frame is not sent to the peer in some cases after it has triggered the connection establishment.
Regards,
Stephan
ATM the reconnection is triggered by the first incoming CAN message on the CAN channel that belongs to the route. It seams as if this first frame is not sent to the peer in some cases after it has triggered the connection establishment.
Regards,
Stephan