![]() ![]() This close method will close the socket representing the data attached for security purposes.Ī small process we need to follow for socket creation and proceeding further. Therefore, after creating a socket we need a method to close the socket in code once the work is done. Once we create a socket we need to close it also because we can’t leave it open. Make sure the object must be returned every time you call this method to avoid errors. This output stream method will return the OutputStream representing the data attached to this socket. ![]() ![]() public OutputStream getOutputStream()Īfter creating a socket we need a method to get output from the user in some way. This input stream method will return the InputStream representing the data attached to this socket. public InputStream getInputStream()Īfter creating a socket we need a method to get input from the user in some way. ![]() Here is the list of Socket methods that can be used in programming to make code efficient. One of the ways is: public Socket( InetAddress address, int port ) Int socket ( int domain, int type, int protocol ) Methods of Socket Programming in C++Ī Socket class can be used to create a socket in programming in C++. Web development, programming languages, Software testing & others #include // Include this header file for using socket feature in the code ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |