[Ironpython-users] socketFile.readline never returns

Claudio C claudio at webshell.it
Thu Mar 28 23:53:48 CET 2013


Hello everybody,

I'm calling this method with IronPython but this never ends cause the
second call to readline in the while loop never returns.

This doesn't happend with Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on
darwin

def __getServerReply() :
    """ Internal routine. """
    global __socketFile
    lines = []
    reply = __socketFile.readline(2048)
    idx = reply.find(' ')
    if idx < 0:
        iReply = simwbConstants.NET_BADREPLYFORMAT
    else:
        iReply = int(reply[:idx])
    if iReply == simwbConstants.NET_REPLY_EMPTY:
        return (iReply,[])
    if iReply == simwbConstants.NET_REPLY_ASCII:
        llen = 1
        while llen > 0 :
            l  = __socketFile.readline(__socketBufSize).rstrip(' \n')
            llen = len(l)
            if llen > 0:
                lines.append(l)
                print 'added....'

        return (iReply,lines)

    return (iReply,[])

Does anyone know how to fix it?
Many thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20130328/cbe8f8c4/attachment.html>


More information about the Ironpython-users mailing list