Re: Re: Port Unreachable

Steve Trigero <seecwriter-/[email protected]>
Newsgroups gmane.comp.hardware.rabbit-semiconductor
Message-ID <[email protected]>
I had a similar problem using TCP with the rabbit. After a connection was established, 
if the host then crashed, or otherwise disconnected abnormally, the Rabbit never saw
it and maintained the connection. What I did was to monitor the elapsed time that occurred
since the last received message. And then automatically close the connection once that 
time elapsed. 
But I've never had that problem with UDP, since there aren't connections like you have with
TCP. But perhaps that's do to the way the UDP socket is opened. If you open the UDP socket
specifying a particular IP and Port to connect to, that may be why. I set remip in udp_open() to
-1, which means it will accept a datagram from any host.
 
 
Steve



On Wednesday, October 23, 2013 2:14 PM, ct3lions2000 <[email protected]> wrote:
  
  
>Hi Steve,
>
>Thanks for the reply. 
>
>Yes I am sure I am using UDP. I took the syntax directly from one of the UDP sample programs. It works nicely until the PC which is sending the data screws up and I guess leaves the socket hanging. At this point the only way to reestablish communication is to open and close the socket on the Rabbit. I am trying to make it more robust by sensing this fault condition but I can't find anything on the Rabbit end that detects this fault condition
>
>Regards
>
>
>--- In [email protected], Steve Trigero <seecwriter@...> wrote:
>>
>> I'm confused. There is no "connection" with UDP. Are you sure you're using UDP?
>> I use the following to open a UDP socket:
>>  
>>  udp_extopen( &udpcon[i].socket, IF_DEFAULT, UDP_BROADCAST_PORT, -1, -1, NULL, 0, 0); 
>>  
>>  
>> Also, make sure you are not using the same port number for both TCP and UDP.
>>  
>> Steve
>>  
>>  
>> 
>> 
>> 
>> On Wednesday, October 16, 2013 7:55 AM, ct3lions2000 <terencenixon@...> wrote:
>> 
>>   
>> >Hi Guys
>> >
>> >I have a simple UDP communications set up where I open up a UDP Port on the RCM6710 using:
>> >
>> >udp_open(&sock, LOCAL_PORT, REMOTE_IP,0, NULL)
>> >
>> >I specify an IP Address and port to listen too. I then call TCP_TICK regularly and it works great communicating with a Visual Basic programming running on my PC.  The problem comes when I halt the VB program and restart it. When I restart the VB program and try to send data to the Rabbit I get no reply from the rabbit (rabbit never receives the packet) and using a packet sniffer I see that I get an error packet saying the "Port is unreachable". The only way to correct this is to close the and reopen the socket on the rabbit. 
>> >
>> >I have checked the return values on TCP_TICK and ifstatus and they are both nonzero indicating that as far as the rabbit is concerned the connection is still good.
>> >
>> >Is there a way I can check on the rabbit that everything is OK and reset it if it is not?
>> >
>> >Thanks
>> >
>> > 
>> > 
>> >
>> >
>>
>
>  
> 
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.