# Path: EventHandler.py
# class EventHandler:
# 	"""An abstract class for SIP event handling classes."""
# 
# 	def __init__(self):
# 		pass
# 
# 	def readEvent(self):
# 		"""This function will be called to get a SIP event as return value.
# 		"""
# 		raise SCNotImplemented("EventHandler", "readEvent", "not implemented")
# 
# 	def writeEvent(self, event):
# 		"""This function will be called to write the given SIP event to the
# 		destination.
# 		"""
# 		raise SCNotImplemented("EventHandler", "writeEvent", "not implemented")
# 
# Path: SCException.py
# class SCException(Exception):
# 	"""Generic internal exception class. Consits out of class name, function
# 	name and the reason phrase.
# 	"""
# 
# 	def __init__(self, cls, funct, reason):
# 		Exception.__init__(self)
# 		self.cls = cls
# 		self.funct = funct
# 		self.reason = reason
# 
# 	def __str__(self):
# 		return str(self.cls) + '.' + str(self.funct) + '(): ' + str(self.reason)
# 
# class SCNotImplemented (SCException):
# 	"""See SCException. Called if implementation is missing."""
# 
# 	def __init__(self, cls, function, reason):
# 		SCException.__init__(self, cls, function, reason)


from EventHandler import EventHandler
from SCException import SCException, SCNotImplemented
import Log, Config, socket, select, copy
import SipEvent as SE
import time
# SIP Forum Test Framework is free software; you can redistribute it 
# and/or modify it under the terms of the GNU General Public License as 
# published by the Free Software Foundation; either version 2 of the 
# License, or (at your option) any later version.
#
# SIP Forum Test Framework is distributed in the hope that it will 
# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SIP Forum Test Framework; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# $Id: NetworkEventHandler.py,v 1.23 2004/05/03 21:27:02 lando Exp $
#

class NetworkEventHandler (EventHandler):
	"""This class handles all SIP events which are going and comming over
	network connections.
	"""

	NEH_NO_SOCK = 0
	NEH_BOUND = 1
	NEH_LISTEN = 2
	NEH_CONNECTED = 3
	NEH_HALF_CLOSED = 4
	NEH_CLOSED = 5

	def __init__(self, transp=None, host=None, port=None, addResource=True, createSock=True, eventType=SE.SipEvent):

# Path: EventHandler.py
# class EventHandler:
# 	"""An abstract class for SIP event handling classes."""
# 
# 	def __init__(self):
# 		pass
# 
# 	def readEvent(self):
# 		"""This function will be called to get a SIP event as return value.
# 		"""
# 		raise SCNotImplemented("EventHandler", "readEvent", "not implemented")
# 
# 	def writeEvent(self, event):
# 		"""This function will be called to write the given SIP event to the
# 		destination.
# 		"""
# 		raise SCNotImplemented("EventHandler", "writeEvent", "not implemented")
# 
# Path: SCException.py
# class SCException(Exception):
# 	"""Generic internal exception class. Consits out of class name, function
# 	name and the reason phrase.
# 	"""
# 
# 	def __init__(self, cls, funct, reason):
# 		Exception.__init__(self)
# 		self.cls = cls
# 		self.funct = funct
# 		self.reason = reason
# 
# 	def __str__(self):
# 		return str(self.cls) + '.' + str(self.funct) + '(): ' + str(self.reason)
# 
# class SCNotImplemented (SCException):
# 	"""See SCException. Called if implementation is missing."""
# 
# 	def __init__(self, cls, function, reason):
# 		SCException.__init__(self, cls, function, reason)


# Path: NetworkEventHandler.py
from EventHandler import EventHandler
from SCException import SCException, SCNotImplemented
import Log, Config, socket, select, copy
import SipEvent as SE
import time

# SIP Forum Test Framework is free software; you can redistribute it 
# and/or modify it under the terms of the GNU General Public License as 
# published by the Free Software Foundation; either version 2 of the 
# License, or (at your option) any later version.
#
# SIP Forum Test Framework is distributed in the hope that it will 
# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SIP Forum Test Framework; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# $Id: NetworkEventHandler.py,v 1.23 2004/05/03 21:27:02 lando Exp $
#

class NetworkEventHandler (EventHandler):
	"""This class handles all SIP events which are going and comming over
	network connections.
	"""

	NEH_NO_SOCK = 0
	NEH_BOUND = 1
	NEH_LISTEN = 2
	NEH_CONNECTED = 3
	NEH_HALF_CLOSED = 4
	NEH_CLOSED = 5

	def __init__(self, transp=None, host=None, port=None, addResource=True, createSock=True, eventType=SE.SipEvent):

		EventHandler.__init__(self)