Tags:
create new tag
, view all tags
The threaded interactive chat program reads user input from the command prompt up to a certain length, encodes it into data (or an application layer frame) and passes it down to the network layer along with relevant information to be transmitted to the destination. As this program uses the raw_input() functionality of Python, which seeks to obtain control of stdin (which is usually the same terminal as stdout), the silent flag is set in order to stop any other layer’s messages being displayed on stdout and conflicting with raw_input(). Note that chat packets are of type TYPE_DATA and APP_CHAT. The exit condition is defined as the user inputting ‘exit’ and pressing return or pressing return with an empty input string. After this, the program exits and in turn begins the termination of the rest of WiSeNeT running on that node.
  • Figure 14: Chat program landscape:
    f14.png
Topic revision: r2 - 2012-01-20 - XiaohongWu
 
This site is powered by the TWiki collaboration platformCopyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback