Question: I'm about a couple weeks into learning Python.

With the guidance of user:' Lost' here on Stackoverflow I was able to figure out how to build a simple decoder program. He suggested a code and I changed a few things but what was important for me was that I understood what was happening. I understand 97% of this code except for the `except: i += 1` line in the `decode()`. As of now the code works, but I want to understand that line.

So basically this code unscrambles an encrypted word based on a specific criteria. You can enter this sample encrypted word to try it out. `"0C1gA2uiT3hj3S"` the answer should be `"CATS"`

I tried replacing the except: `i += 1` with a Value Error because I have never seen a Try/Except conditional that just had an operational and no Error clause. But replacing it with Value Error created a never ending loop. 

My question is what is the purpose of writing the except: `i += 1` as it is.

'Lost' if you're there could you answer this question. Sorry, about the old thread

```
def unscramble(elist):

    answer = []
    i = 0

    while i <= len(elist):

        try:
            if int(elist[i]) > -1:
                i = i + int(elist[i]) + 1
                answer.append(elist[i])
        except:
            i += 1

    return "".join(answer)

def boom():
    eword  = input("paste in your encrypted message here >> ")
    elist = list(eword)
    answer = unscramble(elist)
    print (answer)

clear()
boom()

```

Answer: 
You need to use a smaller fixed length buffer when reading from the socket, and then append the received data to a dynamically growing buffer (like a `std::string`, or a file) on each loop iteration. `recv()` tells you how many bytes were actually received, do not access more than that many bytes when accessing the buffer.

```
char buffer[1024];
std::string myString;

int nDataLength;
while ((nDataLength = recv(Socket, buffer, sizeof(buffer), 0)) > 0) {
    myString.append(buffer, nDataLength);
}

std::cout << myString << "\n"; 

```
recv return value is total size of receved data.
so you can know total data size, if your buffer is smaller than total data size there is 2 solutions. I guess...
1. allocate buffer on the heap. using like new, allcoc etc.
2. store received data to data structure(like circular queue, queue) while tatal data size is zero(recv function return)

I prefer to use 2nd solution.
Googling about recv function , socket programming sample codes.
That'll helpfull.