unix domain socket相关
lazycat
posted @ 2012年2月13日 15:33
in linux
, 3268 阅读
1.关于SIGPIPE信号
今天测试代码发现,当已经建立了Stream连接的DomainSocket的服务端进程终止后,客户端进程调用send函数导致客户端进程也退出了的情况。
上网搜了一下,发现是客户端进程收到了一个SIGPIPE信号,信号默认的执行动作是终止退出。
解决办法应该是使用
signal(SIGPIPE, SIG_IGN);
忽略SIGPIPE信号。
这样在断开连接后,还继续调用send的情况下,会返回-1,错误号为EPIPE(Broken pipe)。
PS:在recv(sock, ...) 得到返回值为0的时候表示连接断开,这时候应该调用close(sock)来保证后续不会出现问题。
相关链接:
http://www.cppblog.com/elva/archive/2008/09/10/61544.html
http://stackoverflow.com/questions/108183/how-to-prevent-sigpipes-or-handle-them-properly
2019年9月14日 15:25
Regardless if you own/rent your private home or contain property rentals that you really lease over, cleanliness is extremely important. What type janitorial services are accessible? When it pertains cleaning, reputation is extremely important. You want to pinpoint a service which you could count now on to clean while not stealing, since cleaning more often then not takes set when owners or individuals are over. The maintaining supplies that can be used also are important. You desire to be sure oftentimes Eco-friendly and even safe designed for kids (and even pets if and when they are left).
2019年11月13日 17:25
There are available a time in your rapport where you ought to make any transition with just seeing to from a technical perspective being from a relationship. If you think maybe like you with your partner prepared in a good direction, you should take it to another location level.
2020年3月19日 19:08
Home business list really are compiled and additionally updated each month with help of sources that include yellow pages and posts directories, business credit lines, annual assessments, business and additionally industry web sites, and telephone number verification.
2020年3月19日 19:08
Word wide web Buisness, affiliate promotion and weblog all set off together certainly. In precise, you may well add txt links for the blog reports. These connections will snap your document viewer by way of your web page for any affiliate technique.
2020年3月19日 19:08
Once you hate standing up that morning and preparing to work for a different inividual, then upper body and finally an internet home business. People execute this for many different reasons, like being along with the kids or even a transformation of existence.
2020年3月19日 19:09
Internet Marketing is mostly a broad term together with advertising, supporting, and strengthening unique presence about businesses with digital types. Some for the digital hints that are categorized as the outdoor patio umbrella of 'Digital Marketing' really are digital endorsing, email promotional, content promotional, pay-per-click, via the internet brochures, and better.
2020年3月19日 19:09
Elementary and Imperative Health Packages - A top-notch-quality timber a limited health care benefit during a considerably poor insurance amount. In selecting such type of health insurance plan, it is necessary that you ought to read all the policy profile giving special concentration on covered offerings. There really are plans which may not cover up on a lot of basic applications, certain medical-related services that include chemotherapy, maternal dna care or possibly certain medications.
2020年4月28日 18:54
Once you hire any servant maid to completely clean you house or office, you are usually permitting her to gain access to to your own personal belongings. Thus before signing up a cleaning service, you must ask specific questions to discover more regarding her backdrop information and also personal experience. First factor is in which, you must inquire friends and family, relatives or perhaps acquaintances for personal experience with all the servant maids.
2020年4月28日 18:55
In order to give your property a certain form of atmosphere, then internal paints have become important. The paints that you choose offer either heat or coolness for the rooms of your property and if you would like to paint oneself or retain the services of house painters; keep at heart there are many ideas so that you can consider. These tips include choosing things including the right color, colors, colors, schemes, shade methods, and also other related factors.
2021年6月06日 20:26
Also, high-traffic regions like dining rooms and restrooms require far more attention versus other parts entrance. With skilled guidance, cleaning just about every edge of your dwelling can possibly be easily was able. But, based on the size connected with and style of the housing building, the clean-up approach could possibly vary on occasion. So, now let’s consentrate on the clean-up hacks which might be approved because of the veteran house cleaning experts.
2021年6月06日 20:28
Also, high-traffic regions like dining rooms and restrooms require far more attention versus other parts entrance. With skilled guidance, cleaning just about every edge of your dwelling can possibly be easily was able. But, based on the size connected with and style of the housing building, the clean-up approach could possibly vary on occasion. So, now let’s consentrate on the clean-up hacks which might be approved because of the veteran house cleaning experts.
2021年9月02日 15:42
Virtually all cleaning organisations work in the day time and to try and force your residential home cleaned you will need to at give good results, you is required to be OK with the help of permitting maids to enter your household in a absence. Only then it will be possible for you for the clean house looking for a long day's give good results. Hiring a reliable company which has had a strict acquiring approach as well as insured will reduce the risk from any sort and often will make that is felt more more comfortable.
2024年1月11日 23:08
Bonjour Sachez que les idées de l’ sujet necessiteraient d’autres avis: Cette opinion est défendable cependant je n’approuve pas les divers posts postés ici. Vous pourriez vérifier certaines valeurs pour etre plus rigoureux… Contactez moi au besoin how to make my google docs dark mode