开发者

How can I diagnose problems with Perl's getc?

I am having this strange problems with the getc function. I use getc to get a character from a socket file handler. I need to simulate message exchanges between pc and a mobile device. For the first few messages, getc works fine. But for this one, getc couldn't get anything from the socket. The whole Perl program blocked until I reset that mobile device. But the wireshark shows the message was send to the right port number.

Is there tool I can use to what开发者_Python百科's going on?

Thanks


A common source of problems with file and socket handles is that the end of input can be reached and the handles error or eof flag could be set. Try calling seek HANDLE,0,1 to reset the handle after a call to getc doesn't return anything (or should it be sysseek? Is getc a buffered I/O operation?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜