I'm taking Advanced Java. The assignment I'm battling is to create a ServerSocket and Socket and simulate a change machine.
Following instructions and using the code bits we've been taught and I can find in my Java book, I've designed and created my programs. My Socket program times out when I try to create the connection.
I started off creating the socket and OutputDataStream before the user prompting program ran. When it kept timing out, I thought it might be because I didn't have any data to put into OutputStream at the creation point, so I've changed things around to create/connect the Socket when I've got data to send. moneyInserted is float.
( code is under this cutCollapse )edit: Thanks to everyone who offered suggestions. This hurdle has been conquered. On to the next!