Ticket #871 (closed defect: fixed)

Opened 9 years ago

Last modified 7 years ago

UDPServerSocket getmessage erroneously raises LocalIPChanged

Reported by: armon Owned by: vijay
Priority: major Milestone:
Component: repyV2 Version: 0.1o
Severity: Medium Keywords:
Cc: Blocking:
Blocked By:

Description

Without changing my IP I get:

---
Following is a full traceback, and a user traceback.
The user traceback excludes non-user modules. The most recent call is displayed last.

Full debugging traceback:

"librepysocket", line 395, in accept_waiting
"/Users/adadgar/Projects/seattle/branches/repy_v2/test/namespace.py", line 909, in do_func_call
"/Users/adadgar/Projects/seattle/branches/repy_v2/test/namespace.py", line 1161, in wrapped_function
"/Users/adadgar/Projects/seattle/branches/repy_v2/test/emulcomm.py", line 1981, in getmessage

User traceback:

"librepysocket", line 395, in accept_waiting

Exception (with class 'exception_hierarchy.LocalIPChanged'): The local ip 192.168.0.100 is no longer present on a system interface.

Change History

Changed 7 years ago by justinc

  • owner changed from cemeyer to vijay
  • status changed from new to assigned

Changed 7 years ago by justinc

  • component changed from - to repyV2

Changed 7 years ago by vijay

  • status changed from assigned to closed
  • resolution set to invalid

In FutureRepyAPI sendmessage call no longer raises the LocalIPChanged exception.
When tried changing the IPaddress after UDPserver is up and listening,getmessage() will raise SocketWouldBlockError? which is appropriate.

Changed 7 years ago by justinc

  • status changed from closed to reopened
  • resolution invalid deleted

Why is this a good exception to raise? How does the programmer know what happened? It seems really odd to raise this exception here....

Changed 7 years ago by vijay

When an IP address of the system is changed a simple TCP and UDP server listening on the system will continue to listen on the old IP address (and port), and the operating system does not appear to notify the socket or the program that its IP address changed. I observed that listening on and then disconnecting the ethernet interface would raise a SocketWouldBlockError? (Repyv2).

A possible solution to make the server program learn about the changed IP address would be to run another program or script that checks if the IP address changed and notifies the server program periodically about the change. Another solution would be to include the same piece of code in the server program itself. It appears that the Shims may have this capability.

UDP:

When an IP address of the system is changed a simple UDP server continue to be binded old IP,port and server will raise a SocketWouldBlockError?.

Changed 7 years ago by vijay

  • status changed from reopened to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.