I want to be able to listen for messages on a socket continuously as I have data coming into the program irregularly. However I also have a need to send data on a button click.