X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fchrome%2Fcommon%2Fextensions%2Fdocs%2Fexamples%2Fapi%2FnativeMessaging%2Fhost%2Fnative-messaging-example-host;h=89da1c07373ccd1e7042e27f92e54f6b9678f685;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=bda9af4b0af08ae717f8dd0679131101bd18f45a;hpb=7338fba38ba696536d1cc9d389afd716a6ab2fe6;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/chrome/common/extensions/docs/examples/api/nativeMessaging/host/native-messaging-example-host b/src/chrome/common/extensions/docs/examples/api/nativeMessaging/host/native-messaging-example-host index bda9af4..89da1c0 100755 --- a/src/chrome/common/extensions/docs/examples/api/nativeMessaging/host/native-messaging-example-host +++ b/src/chrome/common/extensions/docs/examples/api/nativeMessaging/host/native-messaging-example-host @@ -29,7 +29,7 @@ def send_message(message): def read_thread_func(queue): message_number = 0 while 1: - # Read the message type (first 4 bytes). + # Read the message length (first 4 bytes). text_length_bytes = sys.stdin.read(4) if len(text_length_bytes) == 0: @@ -37,7 +37,7 @@ def read_thread_func(queue): queue.put(None) sys.exit(0) - # Read the message length (4 bytes). + # Unpack message length as 4 byte integer. text_length = struct.unpack('i', text_length_bytes)[0] # Read the text (JSON object) of the message.