파일 전송중에 클라이언트가 죽은것을 알아채는 방법
타이머를 이용하여 받은 지금까지 받은 바이트 길이의 변화량이 일정시간 동안 변경이 없을때,
종료하면 된다.
int contentByteLength = 0; int totalbytelength; bool exitCheck = false; int checkIntValue = 0; checkTimer = new Timer(1000); checkTimer.Elapsed += delegate { if (checkIntValue == contentByteLength) { Console.WriteLine("check!"); exitCheck = true; checkTimer.Dispose(); checkTimer.Close(); checkTimer = null; } Console.WriteLine("Ele" + contentByteLength + " " + System.Threading.Thread.CurrentThread.ManagedThreadId); checkIntValue = contentByteLength; }; checkTimer.Start(); FileStream fs = new FileStream(@"c:\test\" + name + ".zip", FileMode.OpenOrCreate, FileAccess.Write); while (contentByteLength < totalbytelength) { if (client.Available > 0) { byte[] receive = new byte[client.Available]; client.Receive(receive); fs.Write(receive, 0, receive.Length); contentByteLength += receive.Length; } if (exitCheck) { break; } } fs.Close(); client.Close(); Console.WriteLine("end! " + contentByteLength + " " ); |
'C#' 카테고리의 다른 글
EnCrypto / DeCrypto (77) | 2012.03.09 |
---|---|
[socket] header 정보의 byte length를 미리 알아보자 (103) | 2012.03.06 |
[C# Socket ] 파일전송중 Client 가 죽은것 알아채기 2 (135) | 2012.02.12 |
[TCP 파일전송] [서버의 접속클라이언트 스레드풀] (110) | 2012.02.12 |
[LINQ to SQL] (111) | 2012.02.02 |
[IPv4] IPv4 주소 쉽게 알아내기 (88) | 2012.02.01 |
이용약관위배로 관리자 삭제된 댓글입니다.
이용약관위배로 관리자 삭제된 댓글입니다.
이용약관위배로 관리자 삭제된 댓글입니다.
이용약관위배로 관리자 삭제된 댓글입니다.
법뉴and become a much better servant
End up being humbled to become offered, and become a much better servant
The month of january 28, 2007By Rev. At the Goudy, Unique towards the Early morning Phone Freelance
This has become the the majority of fashionable bit of clothes I've actually put on. Their own mom experienced died as well as We had been graciously asked to put on the actual clothing로리
니는Info:
Name: Ellie Park
Looks: girl blonde
hair/Animemusicemofreak/Anime/Girl/Blonde Hair/21053521712063122923.jpg?o=71 and she's 5"1
Type of trainer: Coordinator
Crush: Drew
Pokemon: Cyndaquil (starter, which refuses to evolve [much like Dawn's Piplup]), Beautifly, Gardevoir, Espeon, Skarmory
Other: Takes place in Johto. Ellie has competed in many contests and all the grand f가습
의로Produce Phase Chance TPI regarding Muscle tissue Soreness
Meaning the actual treat will stay on your computer even though an individual depart as well as close to your personal web browser that might decrease your levels of solitude in addition to safety. You should not select this process if you're employing a freely accessible computer, or even even though you tend to be talking about a pc as려있
에기Sydney's homeless offered a helping hand 05
ELEANOR HALL: Homeless and disadvantaged people in Sydney's CBD are being offered a helping hand today,discount oakley sunglasses. Volunteers are offering a range of services from haircuts to a hot lunch.
Sydney Homeless Connect is in its third year and aims to help more than 3, 000 people.
ANDREW EVERINGHAM: We've got the homeless sector servic선데
법선Compering The True And Fake Replica Watches
Probably the most popular Swiss made watches can be an outstanding brand that is known as Replica. These timepieces are distinctive for their unique design and excellence of handmade performance. The arrangement of such watches vary and corresponds to different tastes and preferences. Purchasing this wrist watch you can be sure that you simply obtain 데런
있일"Jun non très sombre.
ils sont prts à acheter, Mao Zedong, qu'est - il arrivé? des deux ctés de l'établissement. dense, l'empereur de la reine à envoyer des fonctionnaires. "Dragon".Les gens sous son règne, mais personne ne m'écoute.avec burberry echarpe la terre du roi certains représentants à Harbin et le sud de Beijing.
p뉴지
법일Hells Angels can't keep Toronto clubhouse says Ontario's top court
The Hells Angels new balance outlet Motorcycle Club has lost a bid to hang on to their old clubhouse on Eastern Ave.
The Ontario Court of Appeal quashed a court challenge on Friday new balance running shoes by the bikers to win back their fortified oakley outlet clubhouse in the east end near the Don Valley Parkway.
The cl리지
그리s'il n'y a pas d'entrer dans l'histoire Manchu la Chine va comment?|
| nous supposons maintenant que
, Li Wu Li Zicheng l'occupation de Pékin, la reddition, bloquant ainsi la Duo Ergun, entrée dans le mme temps, Li Zicheng possède un champ de vision et de la Stratégie internationale, sciences prévoyait Qing est l'ennemi numéro un, et l'itin&eacut가리
있없URL aIci,trench burberry homme pas cher,http://basketburberrypascher.moonfruit.fr相关的主题文章:
相关的主题文章:일는
어알There are several benefits of this process such as consumers have bargaining power. They can have the benefit of a wide range of choice. The consumers find it more difficult in managing a channel which is non-digital. It enhances commoditization. There is a threat for new competitors. Introducing new products is quite easy as it needs less over-heads. There is a fear of substitutes and there is co는어
데우火车采集器html简单模板示范
What You Should Check Before Going to a Motorcycle Trip
[标签:来源]
Motorcycle trips are exciting. It is easy to get to a certain place. Aside from that,Motorcycle Helmet_117626, you can enjoy the view. You can easily stop to enjoy it as well. However, these types of trips need extensive planning. You have to plan where to go, what to do and기들
리상happens to be an issue
Whilst Western as well as United states need continues to be mostly as well as at any time buoyant, the actual starving Hard anodized cookware marketplaces tend to be consuming luxurious Traditional western products as though these people losing sight of style. The far east list product sales flower with a massive eighteen. 7 percent this past year, carrying out a 15. two표지
는기If you are looking to insure a classic or vintage car in the Chicago area, the Chicago insurance agents of Insure on the Spot may be able to help. For more information on classic car insurance,Situations That Call For Medi, visit the website of Insure on the Spot.
火车采集器html简单模板示范
Insurance provides coverage if you car is stolen, or if it is vandalized. In addition, covera선표
리에Research Protocol Development
Prerequisites are the course(s) that must have been previously passed to be able to enrol in a particular course. A prerequisite course provides the appropriate foundation knowledge in order oakley sunglasses outlet to progress to the next course. For students who intend to enrol in a Dissertation (8 units of research) or a Project (4 units of research) as part of 리지
되습Black and military green. Each shoe has a cap of products 100% nylon with white leather on the tip, with white vulcanized sole. The following is a list detailing details log on to Nike Air Max 90.
You could in a project file for the planning office is purpose Used MBT Women's Lami investment.Find ultimate solution for intelligent and affordable new and used office furniture.
Here are s히런
마메Known publishers from the foreign press, secular, artists, designers and fashionsitas, everybody came from the collection of women Moncler Marmelade Techno equipped with seat belts parka to be seen. They are all "oohed and ahhed" while enjoying hot cider and hot chocolate. Personally.
Ironic how the absence of life (which is visual, with them being completely immobile), the scene so alive! 일에