Java source code analysis socket (3)

    I have written two articles about sockets before, and I have basically explained all the content that I think is more important. Therefore, this article is mainly the results of debugging, experience and so on. At the same time, there is a practical operation of the tcp/ip protocol. After thinking about it, it is better to open a separate article. It is logically easy to distinguish and it is also convenient for you to review in the future. Next start debugging the results:

    The first proposed is the closed-loop problem mentioned in the first article, which has not been solved so far. Wait until you have time to study it carefully.

    

    

    This is the connection-oriented instantiation method I used in a debugging. Since the test server set a timeout, an error was reported on the way of running. At the same time, there were many classes. At that time, there was no screenshot because it was relatively late. .

    Just from these two pictures and my own memories to record:

        First of all, it can be seen from this picture that although the constructor of Proxy is not called, it still uses the class of this proxy during operation. At the same time while running, I observed that it calls the String class a lot. Then I thought about it carefully, isn't it? After all, the communication in human-computer interaction is character or Chinese is still the majority for us Chinese. The String class only knows that it is very important, but I haven't read its source code carefully. And it can store numbers, letters, and characters and dynamically change the content, such as through the common + operation. Another class that is called a lot is URI. Uniform resource locator is not the first time to hear it, but this class in java is rarely paid attention to, after all, it is a class under the core package. On the one hand, I am afraid that the content involved is too complicated to understand, and on the other hand, I do not realize its importance. To put it bluntly, it is the breadth of its use. As an interest, it is natural to study its depth.  

    In addition, it also uses a lot of reflection methods while running, for reflecting classes and objects, methods and properties, but I forgot where the reflection is, but at least I know that it uses reflection in operation. When it comes to reflection, it is natural to think of dynamic proxies. From now on, I think reflection is a key point for a programmer to advance, at least for a Java programmer. Because it changes our thinking mode to some extent, it is equivalent to opening a new door. Otherwise, you will always be confined to your own one-third of an acre of land and continue to do meaningless labor. It is also the source of many excellent frameworks. So have to watch. 

    I feel a little tired now, but I still persevere and write the last article about tcp. In fact, it should have been written long ago, because more than a year has passed since I learned theoretical knowledge. Because I am testing the socket based on java, it will be listed in the next article of this series.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324773347&siteId=291194637