Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- socket = new Socket(host, port);
- socket.setTcpNoDelay(true);
- while(!dataList.isEmpty()) {
- String data = dataList.removeFirst();
- inMemoryCount -= data.length();
- try {
- OutputStream os = socket.getOutputStream();
- os.write(data.getBytes());
- os.flush();
- }
- catch(IOException e) {
- inMemoryCount += data.length();
- dataList.addFirst(data);
- socket = null;
- return false;
- }
- }
- return true;
Add Comment
Please, Sign In to add comment