We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Socket socket = server.accept();
InputStream is = socket.getInputStream();
byte[] buf = new byte[10000];
int read;
while ((read = is.read(buf)) != -1) {
// do something with buf here
}
Don't forget that part of this code must be in the implementation of the thread.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
UDS Echo Server
You are viewing a single comment's thread. Return to all comments →
Try to read from the socket. Example:
Don't forget that part of this code must be in the implementation of the thread.