Your socket must be set to blocking mode, there recv waits indefinitely until it receives data. The easy fix here is to set the socket to nonblocking mode (see “setblocking” in the Python reference), in which case recv will not return anything if there is no data available instead of blocking until there is data available.
(Alternatively, you could add your task to a task chain and have it use a separate thread, but this is probably not necessary.)
Still, it doesn’t look like your code should work as you might receive “te” one frame and “st” the other. You should probably store the data in a variable and keep appending to it until it contains what you need; alternatively you could use the “yield” keyword in the task until it has gathered the entire message.