简体   繁体   English

套接字python中的管道损坏

[英]Broken pipe in socket python

i'm using this library in order to print to thermal printers via ethernet: https://github.com/Simonefardella/escposprinter 我正在使用此库以便通过以太网打印到热敏打印机: https : //github.com/Simonefardella/escposprinter

But, when i'll launch a lot of prints, after a while i'm getting error 32 Broken Pipe. 但是,当我要启动大量打印时,一段时间后我遇到了错误32 Broken Pipe。

I don't know why, and i really need a solution, because, if i'll launch from two different ip's two prints everything stop working and i have to relaunch the print command... 我不知道为什么,我真的需要一个解决方案,因为,如果我要从两个不同的ip的两个打印启动,一切都会停止工作,我必须重新启动打印命令...

I don't know why, there is something related with the socket? 我不知道为什么,这和插座有关吗?

Many thanks. 非常感谢。

You get Broken Pipe error because one of your end tries to send data to an already closed connection, in this case the printer. 您收到“ Broken Pipe error因为您的一端尝试将数据发送到已经关闭的连接(在这种情况下为打印机)。

Most probably the socket is closed after a sometime, or for a request it ends with a timeout which results in a closed connection. 套接字很可能在一段时间后关闭,或者对于请求,它以超时结束而导致关闭连接。

What are you saying is that only after a while you get this error. 您的意思是,仅在一段时间后出现此错误。 Try to re-connect when you get [Errno 32] Broken pipe . 遇到[Errno 32] Broken pipe时,尝试重新连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM