Now let's talk about the final content: Network programming:
1):TCPthe thread is communicating with the thread! The internal implementation mechanism is this:There is a thread that listens to a port first. Then assume that there isSocketWhen the connection comes up, the server generates aSocketobjects to communicate with them! 2): byURLobject to get the input stream for a particular site. (but this input stream is also relative to the program!) Returned is aInputStreamsub-class!)
URL url = new URL ("http://www.baidu.com");
HttpURLConnection urlconnet = (httpurlconnection) url.openconnection ();
InputStream in = Urlconnet.getinputstream (); 3): In network programming, the data is communicated through bothSocketobject to get, and then all of them areIOof knowledge. 4): There are also non-connectedUDP, throughDatagramand theDatagrampacketTo achieve!
Mind map: This is the Intelligence podcast Chengdu Java Training Center students struggle for their dreams.
|
Dreaming of Java Fundamentals in IBM-network programming