本文整理汇总了Python中Function.get_ipv6方法的典型用法代码示例。如果您正苦于以下问题:Python Function.get_ipv6方法的具体用法?Python Function.get_ipv6怎么用?Python Function.get_ipv6使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Function
的用法示例。
在下文中一共展示了Function.get_ipv6方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: logout
# 需要导入模块: import Function [as 别名]
# 或者: from Function import get_ipv6 [as 别名]
def logout(ip):
print ("\n>>> LOGOUT")
i = 0
pk = pack.logout()
s = func.create_socket_client(func.get_ipv4(ip), const.PORT);
if s is None:
func.error("Errore nella chiusura del demone:" + func.get_ipv4(ip))
else:
s.sendall(pk)
s.close()
i = i + 1
s = func.create_socket_client(func.get_ipv6(ip), const.PORT);
if s is None:
func.error("Errore nella chiusura del demone:" + func.get_ipv6(ip))
else:
s.sendall(pk)
s.close()
i = i + 1
if i is 2:
print ("Logout eseguito con successo.")
示例2: input
# 需要导入模块: import Function [as 别名]
# 或者: from Function import get_ipv6 [as 别名]
listResultQuery = []
####### INIZIO CLIENT #######
nGroup = input("Inserire il numero del gruppo: ")
nElement = input("Inserire il numero dell'elemento del gruppo: ")
host = ("172.030." + func.format_string(nGroup, const.LENGTH_SECTION_IPV4, "0") +
"." + func.format_string(nElement, const.LENGTH_SECTION_IPV4, "0") +
"|fc00:0000:0000:0000:0000:0000:" + func.format_string(nGroup, const.LENGTH_SECTION_IPV6, "0") +
":" + func.format_string(nElement, const.LENGTH_SECTION_IPV6, "0"))
print ("IP:", host)
####### DEMONI
daemonThreadv4 = daemon.Daemon(func.get_ipv4(host), listNeighbor, listPkt, listResultQuery, host)
daemonThreadv6 = daemon.Daemon(func.get_ipv6(host), listNeighbor, listPkt, listResultQuery, host)
daemonThreadv4.setName("DAEMON IPV4")
daemonThreadv6.setName("DAEMON IPV6")
daemonThreadv4.start()
daemonThreadv6.start()
# Menù di interazione
while True:
choice = input("\n\nScegli azione:\nupdate\t - Update Neighborhood\ndelete\t - Delete Neighborhood\nview\t - View Neighborhood\nsearch\t - Search File\nquit\t - Quit\n\n")
if (choice == "update" or choice == "u"):
updateNeighbor(host, listNeighbor)
elif (choice == "delete" or choice == "d"):
del listNeighbor[:]