本文整理汇总了Python中Server.Server.recv_message方法的典型用法代码示例。如果您正苦于以下问题:Python Server.recv_message方法的具体用法?Python Server.recv_message怎么用?Python Server.recv_message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Server
的用法示例。
在下文中一共展示了Server.recv_message方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print
# 需要导入模块: from Server import Server [as 别名]
# 或者: from Server.Server import recv_message [as 别名]
from Server import Server
Server.start()
print("Server is listening...")
while True:
print(Server.recv_message())
client_message=input("Server your turn: ")
Server.send_message(client_message)
lient [Algorithm]
1. Create a Client
2. Give the client an identity , The identity should be the Unique ID
3. Connect the client to the server
4. Wait for the server to send a command
Client Send Message [Algorithm]
1. Send six message frame
Frame[0] = Unique ID
Frame[1] = Delimiter (Should be and empty Frame)
Frame[2] = Details about the client [This should be an xml Document, see client Detail for further information]
Frame[3] = Delimiter (Should be and empty Frame)
Frame[4] = Type of Message Been Sent e.g File,ScreenShot [ The type should be kept short to prevent data wastage ]
Frame[5] = Delimiter (Should be and Empty Frame)
Frame[6] = Payload [The message itself]
Client Details [Algorithm]
1. The clients details should be an XML format string containing the ComputerName,Username,UniqueID and IPAddress
2. Every message (Frame) sent will contain the ID of the Client in Frame[0] and the client Details in Frame[2]