Research on Flying Pigeon

Source: Internet
Author: User

It is too convenient to transfer files in the LAN. Today, I don't know which tendon has a problem. I want to simulate it. so you can start it directly. the architecture of Feige is not difficult, but it is easy to tell. however, it is easy for me to suffer.

 

For the first time, I used asynchronous events and UPD multicast.CodeIt's not hard. When I finish the test and sniff other computers, the UPD multicast messages won't send events to anyone. the bound address is the local address, but the trusted address is the UPD multicast address. so this idea was directly dispelled. but there are certainly other solutions to this problem. that is, asynchronous messages. it does not care how your data is sent, as long as there is data, it will deliver the fd_read message. so try to write.

 

After the code is completed. I did a test and used my friend's three computers for sniffing. I did not expect it. therefore, the data transmission speed is very fast because it is a LAN, so it is not considered to use a stream socket for sending. Therefore, UDP is directly used, which is very convenient. and very easy. the most troublesome thing is to transfer files. files cannot be completed at one time. Therefore, I divided them into reading a little bit of data and then using our boss's ideas. I asked him to answer questions and asked him to adopt the iocp model, which was completed soon, message verification, because it is only a test, I simply defined several strings and sent a flag after the file transfer is complete. I thought it would waste a lot of time on the network. but unexpected things happen.

 

I spent more than three hours thinking about reading and writing files. How long has it been for a programmer? I am also depressed !, The following describes the problem. it is common sense to read a file. The file name can be directly used. however, my programming environment is vista. Do not ignore this sentence. he used d3d10. Simply put, it is com. Everyone knows that? Only Unicode is supported, but ANSI is not supported. This problem causes me to read the file for a long time and has not been correct. after the reason is found for reading the file. write the file. I am confused. Reading files is binary, and writing files is binary. But after I write it into the file, it is garbled and I am depressed. So I changed it to the ANSI reading method, succeeded... I have been bored for a long time, so I wrote a file with a length of 256, but a lot of data is useless. I don't need to write it into the file, so I took the string length and then wrote the required data into the file, the function is successfully executed, but there is no data! Continue to be depressed!

 

So I asked a friend why he had spent a long time! So let me be aware of several issues, or I will use Unicode programming in the future, or I will not program it in Vista. Remember, or I will useC LanguageFunction to read and write files, either using APIs, using less than 10 million C ++ file streams, too many bugs, this is the fifth time I have, my friends also have! Depressed!

 

I spent five hours in total, but it took less time and less time. I don't know what the problem is!

 

In the classic words of the boss, computers will not betray you ........

 

Fliggy biographyIntroduction

IpmsgFliggy biographySystem instant messaging

Fliggy biographyLAN chat tools

Fliggy biographyInternal eye protection

XeimFliggy biographyDatabase description

Fliggy biographyRegular Expression

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.