<img goomoji="35C" style="margin: 0pt 0.2ex; vertical-align: middle;" src="cid:35C@goomoji.gmail"><br><br>Additionally, some people may not encounter this problem in the first place:<br>If your call to <span style="font-family: courier new,monospace;">sock.bind((host, port))</span> occurs within the <span style="font-family: courier new,monospace;">Server.__init__()</span> method, then you will run into this problem with the old tests.  Otherwise, that code will never be run (unless, for some reason, you&#39;re binding to the port in the <span style="font-family: courier new,monospace;">handle_connection()</span> method, in which case, seek help) and you will never know the difference.<br>

<br>--Joe A.<br><br><div class="gmail_quote">On Wed, Oct 28, 2009 at 9:57 PM, Steve Wakeford <span dir="ltr">&lt;<a href="mailto:wakeford@msu.edu">wakeford@msu.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">




  

<div bgcolor="#ffffff" text="#000000">
Yes it matters because if we forget about just passing the tests for a
minute, the original implies that you are calling the server class
constructor with a port (integer) and an app and the second implies a
hostname (string) and an app. Consistency would be favorable, no?<br>
<br>
Note that yes, if I do hard code this as Amenta suggested all of the
tests pass, thanks to both Joes for assistance.<div><div></div><div class="h5"><br>
<br>
Joseph Blossom wrote:
<blockquote type="cite">Does it even really matter? serve_forever is never being
called by the tests, and therefore the port doesn&#39;t really matter at
all.  In run_fake_socket we can see:
  <div>
  <div><span style="font-family: Times; font-size: medium;">
  <pre>server = webserve_nb.NonblockingServer(&#39;&#39;, hello_app)

done, data = server.handle_connection(sock)</pre>
  <pre><span style="font-family: arial; white-space: normal; font-size: small;"><div>He&#39;s not doing anything over any sort of a network in the tests, but rather creating fake sockets which emulate what a real socket would do. Hence:</div>


<div><span style="font-family: Times; font-size: medium;"><pre>class fake_nb_client_sock_obj(fake_client_sock_obj):</pre><pre><span style="font-family: arial; white-space: normal; font-size: small;">Mine does nothing with the port &#39;&#39;, and passes the tests fine. I suppose you could for the sake of bad input, but to get your code to work with his tests, nothing extra is needed.</span></pre>


<pre><font face="arial"><span style="font-size: small; white-space: normal;">The other Joe</span></font></pre></span></div>
</span></pre>
  </span><br>
  <div class="gmail_quote">On Wed, Oct 28, 2009 at 9:07 PM, Steve
Wakeford <span dir="ltr">&lt;<a href="mailto:wakeford@msu.edu" target="_blank">wakeford@msu.edu</a>&gt;</span> wrote:<br>
  <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I
am a little stumped as to why the Blocking server is instantiated in
the hw7 tests with<br>
    <br>
server = webserve.Server(8000, app)<br>
    <br>
but the Non-blocking server is instantiated with<br>
    <br>
server = webserve_nb.NonblockingServer(&#39;&#39;, hello_app)<br>
    <br>
Notice the first argument is an integer in the former and a string in
the latter. Is it just me or am I missing something? How do we deal
with this (for non-blocking) since the port should be dynamically
passed in upon instantiation from a command line argument?<br>
    <br>
My goal is to subclass the Blocking server and only to override its
__init__() and serve_forever() methods. Any ideas?<br>
    <br>
Thanks,<br>
-Steve<br>
    <br>
_______________________________________________<br>
cse491-fall-2009 mailing list<br>
    <a href="mailto:cse491-fall-2009@lists.idyll.org" target="_blank">cse491-fall-2009@lists.idyll.org</a><br>
    <a href="http://lists.idyll.org/listinfo/cse491-fall-2009" target="_blank">http://lists.idyll.org/listinfo/cse491-fall-2009</a><br>
  </blockquote>
  </div>
  <br>
  </div>
  </div>
</blockquote>
</div></div></div>

<br>_______________________________________________<br>
cse491-fall-2009 mailing list<br>
<a href="mailto:cse491-fall-2009@lists.idyll.org">cse491-fall-2009@lists.idyll.org</a><br>
<a href="http://lists.idyll.org/listinfo/cse491-fall-2009" target="_blank">http://lists.idyll.org/listinfo/cse491-fall-2009</a><br>
<br></blockquote></div><br>