当前位置: 首页>>代码示例>>Python>>正文


Python Function.get_ipv6方法代码示例

本文整理汇总了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.")
开发者ID:tommasoberlose,项目名称:p2p_gnutella,代码行数:22,代码来源:Peer.py

示例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[:]
开发者ID:tommasoberlose,项目名称:p2p_gnutella,代码行数:32,代码来源:Peer.py


注:本文中的Function.get_ipv6方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。