Twitter library problem

I have tested the sample code that provided in twitter library. It always stuck in the middle of client.wait(), forever cannot get the status. Or the other situation is the status return back is failed to connect, but it able to tweet. Anyone face this problem? How to solve this problem? Thank you.