java.net package provides a socket client connections provided communications and telnet apache package TelenetClient, is also a client connection to communicate , what is the difference between the two yet.
Whether from communication, protocols , as well as the advantages and disadvantages in terms of application scenarios can be, the more detailed the better ~ ~
welcome discussions Ha ~ ~ ~ ~
------ Solution ----------------------------- ---------------
first occasionally , the first two fully heard , java provides TCP / IP communications on this one class, you said that the first two one should be made on this basis it with a layer of packaging , personal feeling , maybe it convenient to use the first two points, but when you discover the features it offers , you can not meet your needs , I want to change the trouble, or proposal directly with the Socket bar
------ Solution ----------------------------------- ---------
this API is very clear to see , ah,
First TelnetClient inheritance SocketClient, while the function is basically SocketClient and Socket almost. . So much is TelnetClient out new functionality added . Specific API or to see it: http://commons.apache .org / proper / commons-net / apidocs / org / apache / commons / net / telnet / TelnetClient.html
public class TelnetClient
extends SocketClient
The TelnetClient class implements the simple network virtual terminal (NVT) for the Telnet protocol according to RFC 854. It does not ; implement any of the extra Telnet options because it is meant to be used within a Java program providing automated access to Telnet accessible resources .
The class can be used by first connecting to a server using the SocketClient connect method. Then an InputStream and OutputStream for sending and receiving data over the Telnet connection can be obtained by using the getInputStream () and getOutputStream () methods. When you finish using the streams, you must call disconnect rather than simply closing the streams.
------ Solution ------------ --------------------------------
again in a functional package it.
------ For reference only -------------------------------------- -
feeling is not packaged as Socket simple enough , and as long as the new one , as long as there ServerSocet new server can communicate over . Should be apache 's TelnetClient provides more features, what features it has . .
------ For reference only -------------------------------------- -
not sink ah ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
------ For reference only ------------------- --------------------
Well, knot stickers scattered points ~ Thank you and moderators answer
没有评论:
发表评论