1
Pins

How to use Socket API for creating Client-Server application in Java

published 593 days, 23 hours, 21 minutes ago posted by anishaanisha 595 days, 17 hours, 48 minutes ago
Friday, August 31, 2012 1:48:28 PM GMT Wednesday, August 29, 2012 7:21:49 PM GMT

In this example we make use of ServerSocketChannel and SocketChannel to create a simple Echo application where in the Server would print the data sent by the client. The code is explained with the required comments: import java.io.IOException; import java.net.InetSocketAddress; import java.nio.channels.ServerSocketChannel; import java.nio.channels.SocketChannel; import java.util.Scanner;

category: Java EE | clicked: 4 | | source: www.javabeat.net | show counter code
tags: client server application, Java, socket API


To post comments using your Facebook,Twitter, Gmail etc credentials in the Discus comments section. Or use your Javapins credentials at the end of the page.
To post your comment as a Javapins user please login or signup to Javapins database.