Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)

        def getTransportNumber(_transp):
	if (_transp == socket.SOCK_DGRAM) or (_transp == socket.SOCK_STREAM):
		return _transp
	if _transp.lower() == "udp":
		return socket.SOCK_DGRAM
	elif _transp.lower() == "tcp":
		return socket.SOCK_STREAM
	else:
		raise SCException("NetworkEventHandler", "getTransportNumber", "unsupported transport '"+str(_transp)+"'")
        


src/s/f/sftf-HEAD/TestCase.py   sftf(Download)
from SipReply import SipReply
from SipMessage import SipMessage
from NetworkEventHandler import createMediaSockets, compareHostNames, NetworkEventHandler, getTransportNumber
from FileEventHandler import FileEventHandler
import time, socket
		#ret = []
		if Config.resources.has_key('NEH'):
			key = str(getTransportNumber(_transport)) + str(_lip) + str(_lport)
			if _transport.lower() == "udp":
				key += "00"