Operating systems, Windows programming, networking, sockets

Source: Internet
Author: User

Starter: personal blog, update & error correction & reply

Before a blog post on C/s only remember the idea did not remember the code, and the expression is not clear, after hindsight, this habit to change.

This has been a few days of learning about operating systems, Windows programming and networking, the main reading of the book has the following, have not read or just read a little, write down the title first:
"Modern operating System"
Deep parsing of the Windows operating system
"Windows Programming"
"C # Getting Started classic"
The WPF Programming Guide
"Graphic TCP/IP"
In addition, "TCP/IP detailed", "Java Network Programming", "Netty authoritative guide" is ready to see next.

1. Operating system
ApplicationAndHardwareBetween the mezzanine, the upward exposure of the convenient programming interface, down management hardware.
Core Core:Process,address SpaceAndfile, the three wereCPU、Memory、HDDThe abstract.
ProcessAndThreads's AllContainer, the CPU travels across multiple containers, as if there were multiple CPUs.

2.windows
Divided into the user state and the kernel state , the important code runs in the kernel state, the application runs in the user state, the application is programmed by invoking the API. See "In-depth parsing of the Windows operating system."
Windows API programming, MFC programming, Form programming, WPF programming. Interface programming technology is more and more, but learning API programming is still useful, will understand the underlying principle. Read "Windows Programming".
C # is much like Java, but much more powerful, like java+ syntax sugar, "C # Getting Started classic" is an introductory book.
Now it seems that WPF programming is recommended instead of using form, and the WPF programming book is for the sake of a single purchase, a thick one, lying unreadable.

3. Network
The TCP protocol of the Transport Layer and the IP protocol of the network layer are the most critical, but the graphic TCP/IP is not as simple and cute as the graphic HTTP, possibly because it is more complex.
Also read more, and the most famous "TCP/IP detailed".
Although I use Java for a long time, but in addition to the Web network programming is not much, "Java Network Programming" and "Netty authoritative guide" should read. It's time for the NIO lesson to be mended.

4. A demo
Socket programming is actually enough to develop a variety of C/s programs, the last blog code can not find, this time to re-write, just also learned a bit of Windows programming, using WPF to do an EXE program client, this is really like the C/s program.
The socket is between the application layer and the Transport layer and provides the possibility of using the TCP protocol, which is called by the application layer's program code.
The "read" block in two-way transmission, because while (Xx.readline) is blocked, both the client and the server need to use a dedicated thread to wait for the response.
Threads are like people, traditional single-threaded routines are just a single person's company, and each more thread is like one more employee, so that the same time can really do more things at once, especially blocking this "need to have a person silly" situation. The CPU is the brain, and the process, the thread is the abstraction of the CPU, the multi-process/thread is like many brains, can handle things in parallel, when you find that your program needs more than one brain, use multi-threaded bar.
The code here includes both Java and C # clients, as well as Java-written servers.

Java writes the server into an executable jar package, and then writes a bat script that reads:

Call Java-jar Myserver.jar

will be able to start easily.

The most amazing thing about C # programs is that the function is a class object:
This line (Doclose is a function)

This. Closing + = Doclose;

And this line (Doreceive is a function)

Receivethread = new Thread (doreceive);

The wording of the writing is very comfortable for people.
Then the following is Android-like code, the new thread wants to change the control content cannot be changed directly, because the control belongs to the main thread.

This. Dispatcher.begininvoke (System.Windows.Threading.DispatcherPriority.Normal,(ThreadStart) delegate ()
{
Thelabel.content = msg;
});

The "delegate" thing I feel is like the so-called function literal in JavaScript, or the anonymous inner class in Java (to provide the method body).

Long-term welcome project Cooperation Opportunity Introduction, project income 10% to reward introducer. Sina Weibo: @ Cold Mirror, qq:908789432.


Operating systems, Windows programming, networking, sockets

Related Article

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.