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
_______________________________________________
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users

Reply via email to