[cse491] Example Code Fail

C. Titus Brown ctb at msu.edu
Sun Sep 27 15:19:01 PDT 2009


On Sun, Sep 27, 2009 at 06:14:58PM -0400, Andrew Thielking wrote:
> the mail sample code worked fine for me, but the echo server code keeps
> giving me this error
> 
>   File "echo-server", line 10, in <module>
>     (client_sock, client_address) = sock.accept()
>   File "/opt/lib/python2.5/socket.py", line 167, in accept
>     sock, addr = self._sock.accept()
> socket.error: (22, 'Invalid argument')
> 
> anyone else having trouble with it?

Hi, try using 'sock.listen(5)' first.  Apparently I was wrong to state
that this is an inconsequential parameter ;).

Not a very helpful error message, though, is it!?

--titus

> On Sun, Sep 27, 2009 at 5:20 PM, Joe Amenta <amentajo at msu.edu> wrote:
> 
> > I am having no problem with the example code.
> >
> > [17:18][joe at joe-desktop] ~ $ python
> > Python 2.6.2 (release26-maint, Apr 19 2009, 01:58:18)
> > [GCC 4.3.3] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> import socket
> > >>> sock = socket.socket()
> > >>> sock.connect(("teckla.idyll.org", 25))
> > >>> sock.recv(4096)
> > '220 teckla.idyll.org ESMTP Exim 4.63 Sun, 27 Sep 2009 14:18:31 -0700\r\n'
> > >>>
> >
> > --Joe
> >
> > On Sun, Sep 27, 2009 at 5:02 PM, Owen Pierce <opierce at gmail.com> wrote:
> >
> >> Can anyone else run the example code from lab4?  I'm trying to run the
> >> code from the* Sending mail - example*, but I keep getting
> >>
> >> Traceback (most recent call last):
> >>   File "send-email", line 11, in <module>
> >>     sock.connect(('teckla.idyll.org', 25))
> >>   File "<string>", line 1, in connect
> >> socket.error: [Errno 113] No route to host
> >>
> >> _______________________________________________
> >> cse491-fall-2009 mailing list
> >> cse491-fall-2009 at lists.idyll.org
> >> http://lists.idyll.org/listinfo/cse491-fall-2009
> >>
> >>
> >
> > _______________________________________________
> > cse491-fall-2009 mailing list
> > cse491-fall-2009 at lists.idyll.org
> > http://lists.idyll.org/listinfo/cse491-fall-2009
> >
> >

> _______________________________________________
> cse491-fall-2009 mailing list
> cse491-fall-2009 at lists.idyll.org
> http://lists.idyll.org/listinfo/cse491-fall-2009


-- 
C. Titus Brown, ctb at msu.edu



More information about the cse491-fall-2009 mailing list