Hello,
Here is my n00b question for the day. I have 2 libraries like this:
lowLevelLib.py
highLevelLib.pyCode:from socket import * def connectUdp(host, port): """connectUdp(host,port) Create an UDP socket and connect to host and port. Return the socket and 1/0 if connection was succesfull. """ try: udpsocket = socket(AF_INET, SOCK_DGRAM) udpsocket.connect( (host, port) ) #udpsock.setblocking(0) except Exception, ex: #do something udpsocket.close() udpsocket = None return None, 0 return udpsocket, 1
Ok, now if the connection is succesfull (the socket is created and connects to the host) i will pass the socket that i created to my highLevelLib. Can i be sure that after i use highLevelLib.closeUdp() the socket is destroyed for good? I am pretty sure it is, i mean i free the phone's memory, but i want a second opinion. I don't know how to check this in symbian.Code:import lowLevelLib.py class server(): self.udpScoket = None self.udpState = "closed" """ __init__ + other methods """ def openUdp(self): self.udpSocket, connectOK = lowLevelLib.connectUdp(self.connection.host(), self.connection.udpPort()) if connectOK: self.udpState == "connected" #else: #self.udpSocket = None #self.udpState = "closed" def closeUdp(self): if udpState == "connected": udpSocket.close() udpSocket = None
Thanks

Reply With Quote


