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


Python Server.recv_message方法代码示例

本文整理汇总了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] 

开发者ID:QewBeats,项目名称:py_chat,代码行数:31,代码来源:main.py


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