objgraph无法生成分析图的原因
理解select模块--等待IO完成

socket.error: [Errno 32] Broken pipe错误的原因

妙音 posted @ 2014年1月26日 15:47 in python with tags socket , 16706 阅读
linux下的socket程序,尝试发送消息到已关闭的socket上,会出现此错误.
 
示例代码
服务端server.py
#encoding=utf-8
import socket
import time


def main():
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    sock.bind(('0.0.0.0', 8050))
    sock.listen(5)

    client_sock, address = sock.accept()
    while True:
        msg = client_sock.recv(1024)
        print msg
        client_sock.send('from server: %s' % msg)
        time.sleep(1)
    client_sock.close()
    sock.close()


if __name__ == '__main__':
    main()
 
客户端client.py
#encoding=utf-8
import socket
import time


def main():
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    sock.connect(('0.0.0.0', 8050))
    while True:
        sock.send('hi')
        print sock.recv(1024)
        time.sleep(1)
    sock.close()


if __name__ == '__main__':
    main()
 
运行server.py和client.py,然后中断client.py会出现上面错误。
Avatar_small
LEGEND SEO 说:
2021年1月05日 16:05

Merely a smiling visitant here to share the love (:, btw outstanding style. movies 123

Avatar_small
Imamia Quran Academy 说:
2023年7月23日 05:57

Your blog provided us with valuable information to work with. Thanks a lot for sharing. I am from Imamia Quran Academy. Online Shia Quran Center provides you Shia Quranic education by the best scholars. Also, authentic Shia Quran translation and Shia Quran commentary are available for online users. Online users will be provided with the authentic experience of a regular Shia Quran Center without being physically present in certain premises.

Avatar_small
sharxs 说:
2023年12月07日 15:56

Indeks berita terkini dan terbaru hari ini dari peristiwa, kecelakaan, kriminal, hukum, berita unik, Politik, dan liputan khusus di Indonesia dan Internasional.

<a href="https://www.prepperdome.com/">https://www.prepperdome.com/</a>
<a href="https://www.kameraleder.com/">https://www.kameraleder.com/</a>
<a href="https://www.themooc.org/">https://www.themooc.org/</a>
<a href="https://lanternbooks.com/">https://lanternbooks.com/</a>
<a href="https://www.americandivecenter.com/">https://www.americandivecenter.com/</a>
<a href="https://pulpitocristao.com/">https://pulpitocristao.com/</a>
<a href="https://statiatourism.com/">https://statiatourism.com/</a>
<a href="https://tuomas-holopainen.com/">https://tuomas-holopainen.com/</a>
<a href="https://arrestedworld.com/">https://arrestedworld.com/</a>
<a href="https://askafreemason.org/">https://askafreemason.org/</a>
<a href="https://alphadeltacom.com/">https://alphadeltacom.com/</a>
<a href="https://revolvemerchandise.shop/">https://revolvemerchandise.shop/</a>
<a href="http://thelongestlistofthelongeststuffatthelongestdomainnameatlonglast.com/">http://thelongestlistofthelongeststuffatthelongestdomainnameatlonglast.com/</a>
<a href="https://allnewsweb.com/">https://allnewsweb.com/</a>
<a href="https://thenewcanadians.com/">https://thenewcanadians.com/</a>
<a href="https://cartografareilpresente.org/">https://cartografareilpresente.org/</a>
<a href="https://endthepainproject.org/">https://endthepainproject.org/</a>
<a href="https://www.stephenson-county-il.org/">https://www.stephenson-county-il.org/</a>
<a href="https://wii-brasil.com/">https://wii-brasil.com/</a>
<a href="https://athomeplate.com/">https://athomeplate.com/</a>
<a href="https://thecheaproute.com/">https://thecheaproute.com/</a>
<a href="https://www.stringbusters.com/">https://www.stringbusters.com/</a>
<a href="https://www.sausagesource.com/">https://www.sausagesource.com/</a>
<a href="https://steveroggenbuck.com/">https://steveroggenbuck.com/</a>
<a href="https://www.actioncarrental.com/">https://www.actioncarrental.com/</a>
<a href="https://www.mst3ktemple.com/">https://www.mst3ktemple.com/</a>
<a href="https://www.comediansusa.com/">https://www.comediansusa.com/</a>
<a href="https://www.fadwebsite.com/">https://www.fadwebsite.com/</a>
<a href="https://www.expocomic.com/">https://www.expocomic.com/</a>
<a href="https://www.nshp.org/">https://www.nshp.org/</a>
<a href="https://www.familiasunidasjusticia.org/">https://www.familiasunidasjusticia.org/</a>
<a href="https://www.bay-journal.com/">https://www.bay-journal.com/</a>
<a href="https://pubarticles.com/">https://pubarticles.com/</a>
<a href="https://ihearthu.com/">https://ihearthu.com/</a>
<a href="https://bestechvideos.com/">https://bestechvideos.com/</a>
<a href="https://swoodbridge.com/">https://swoodbridge.com/</a>
<a href="https://michiganyoutharts.org/">https://michiganyoutharts.org/</a>
<a href="https://crujonessociety.com/">https://crujonessociety.com/</a>
<a href="https://mustangdaily.net/">https://mustangdaily.net/</a>
<a href="https://midway.movie/">https://midway.movie/</a>
<a href="https://modmobilian.com/">https://modmobilian.com/</a>
<a href="https://lafriqueadulte.com/">https://lafriqueadulte.com/</a>
<a href="https://www.canosoarus.com/">https://www.canosoarus.com/</a>
<a href="https://scalingsocialbusiness.com/">https://scalingsocialbusiness.com/</a>
<a href="https://www.unitedwaytyr.com/">https://www.unitedwaytyr.com/</a>
<a href="https://blessedmariannecope.org/">https://blessedmariannecope.org/</a>
<a href="https://www.vanessahudgensofficial.com/">https://www.vanessahudgensofficial.com/</a>
<a href="https://www.outletmichaelkorsuk.co.uk/">https://www.outletmichaelkorsuk.co.uk/</a>
<a href="https://andotadao.org/">https://andotadao.org/</a>
<a href="https://www.monitortalent.com/">https://www.monitortalent.com/</a>

 

Avatar_small
sarah 说:
2023年12月29日 00:23

I found your article to be both enlightening and engaging. The depth of insight coupled with your captivating writing style makes for a compelling read.Fmovies

Avatar_small
Will Zeal 说:
2024年1月17日 19:07

Uncover expert insights at Will-Zeal blog, offering an ultimate guide to online gaming, betting, gambling, jackpots, and poker. Elevate your gaming experience with strategic tips and thrilling revelations.
<a href="https://www.will-zeal.net/">Will zeal</a>

Avatar_small
ads 说:
2024年1月17日 19:09

[Nyc](https://binfile.org/)

Avatar_small
Imamia Quran Academy 说:
2024年1月18日 08:28

Online Shia Quran Academy is an institute for Quran Education. They have trained teaching staff along with renowned Islamic Scholars for a better understanding of the Quran. Shia Quran Academy is an Online Ahle Tashi Institute that has all the features of traditional madrasahs including the teaching of an authentic understanding of the Quran. Additionally, Shia Quran Academy Online provides all teaching by certified professional teachers. Thus, joining Quran Academy will be suitable and beneficial for every learner. It is very difficult to find a good Online Shia Quran Center with Shia Teachers abroad except in Muslim or especially Ahle Tashi majority countries. Imamia Quran Center connects students virtually from all over the world including countries with less or no Ahle Tashi population or Shia Quran Centers. Our Quran Academy is a comprehensive institution with full fledged facilities regarding Shia Quran Learning. Ahle Tashi Quran student is free to choose the timings of classes, lecturers and tutors according to their feasibility and availability to Learn Shia Quran. Online learning more efficiently saves time and money spent over conveyance and physical going to any conventional Shia Quran Institute. Online Shia Madrasa selects highly qualified Quran teachers, keeping in mind the ages of kids and adults, who teach kids and adults Quranic education as well as their beliefs, spirituality and worldly life. The Shia Quran Madrasa Online is a secure place for kids and adults to learn and memorize the Quran. They teach the translation and interpretation of the Holy Quran under the guidance of expert Quranic teachers. Our Shia Quran Madrasa is second to none in providing education to Ahle Tashi women’s. So our center has selected Ahle Tashi Female Quran teacher with higher education from Madrasas. Online Shia Quran Madrasa is one of the best academies providing its services all over the world including USA, UK, Canada, Germany, France and Australia. Shia Quran Academy, a leading Online Shia Academy in the USA, offers exceptional virtual services that are accessible to anyone worldwide.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter