System Settings:
It's critical to have a godo file descriptor limit:
sysctl -w fs.file-max=250000

psrinivasan@psrinivasan-wsl1:~$ ulimit -n
8192
psrinivasan@psrinivasan-wsl1:~$ ulimit -Hn
100000
psrinivasan@psrinivasan-wsl1:~$ ulimit -n 99999

in /etc/security/limits.conf

psrinivasan soft nofile 200000
psrinivasan hard nofile 200000

And to have a god enough port range:
sysctl net.ipv4.ip_local_port_range

and set to
echo 1024 65535 > /proc/sys/net/ipv4/ip_local_port_range
or
sudo sysctl -w net.ipv4.ip_local_port_range="1024 64000"

and to persist - type into /etc/sysctl.conf
net.ipv4.ip_local_port_range = 1024 65535

In order to run the handshakes stress test, use the target

mvn package
mvn exec:exec

Other interesting mvn targets:
mvn compile
mvn test
mvn package

to create a set of jars for distribution:
mvn jar:jar
mvn dependency:copy-dependencies


To generate a fresh version of the FSM, navigate to the smc directory and issue the following command:
java -jar <path_to>/Smc.jar -sync -java StreamingClientFSM.sm
java -jar ~/projects/smc/bin/Smc.jar -sync -java StreamingClientFSM.sm

To generate a html table:
java -jar ~/projects/smc/bin/Smc.jar -table StreamingClientFSM.sm

To generate a debug class:
java -jar ~/projects/smc/bin/Smc.jar -g1 -sync -java StreamingClientFSM.sm



mvn install:install-file
  -Dfile=lib/Smc.jar
  -DgroupId=org.myownsmcjar
  -DartifactId=my_smc
  -Dversion=1.0
  -Dpackaging=jar
  -DgeneratePom=true


TODO: implement a client abstraction that allows for a handler to store session ids and usernames and appropriately log them.
TODO:  implement state management for clients
TODO:  more readme material.
TODO:  BUG: if connect receives an unknown client error, the client goes into the Connected state.
SEVERE: Request failed. State is: FSM.Connected Response is: [{"channel":"/meta/connect","clientId":"1xe7ep1w4t7b6797gccgddoj4c2","advice":{"reconnect":"handshake","interval":500},"error":"402::Unknown client","successful":false}]
TODO:  Make sure concurrency permits are appropriately released in error conditions