Skip to content

Instantly share code, notes, and snippets.

View linead's full-sized avatar

Daniel Fullarton linead

  • Melbourne, Australia
View GitHub Profile
@linead
linead / gist:198bd705549ec1b68768
Created February 19, 2015 12:44
Netty Socket Client
I have a server Foo, that I connect to via a simple socket. I write text into the socket to send it messages and it replies with a response to my query once it's processed it, however it makes no guarantee of the order of responses. I can link up requests and responses with IDs.
Ex :
Send "1:request" to Foo
Foo Returns "1:response
Send "1:request" & "2:request" to Foo
Foo Returns "2:response"
10 seconds later
@linead
linead / HashSet Order
Created November 27, 2014 23:40
Demonstrating the difference in order when iterating a HashSet in java 6/7 to java 8
import java.util.*;
/**
* Results :
*
* /usr/java/jdk1.8.0/bin/java
* First = EEEE last = DDDD
*
* /usr/java/jdk1.7.0_40/bin/java
* First = IIII last = HHHH