Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 5 15:46:03 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m95Mk3sA012926 for ; Sun, 5 Oct 2008 15:46:03 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m95MpfCl007356 for ; Sun, 5 Oct 2008 15:51:41 -0700 Message-Id: <200810052251.m95MpfCl007356@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Regarding port number field in message Date: Sun, 05 Oct 2008 15:51:41 -0700 From: Bill Cheng Someone wrote: > I have a question about message format. The request and response > messages have a field of 2 bytes for storing the port number of the > sender. But if we use integer to store the port number, how can we put > it into 2 bytes? The port number is a 16-bit quantity. You can use uint16_t. You should call htons() to convert the 16-bit integer to Network Byte Order (although this is a no-op on nunki). -- Bill Cheng // bill.cheng@usc.edu