func (s *Socket) handleMessagesIn() {
	for {
		m := <-s.messagesIn
		switch m.MessageType {
		case PLACE_ORDER:
			s.placeOrder(m.Payload)
		case CANCEL_ORDER:
			s.cancelOrder(m.Payload)
		case SIGNED_DATA:
			s.executeOrder(m.Payload)
		case DONE:
		default:
			panic("Unknown message type")
		}
	}
}
// handleMessagesIN listens on the messageIn channel and routes them to the appropriate
// handler based on their MessageType
handleMessagesIN listens on the messageIn channel and routes them to the appropriate
handler based on their MessageType
// handleMessagesIN listens on the messageIn channel and routes them to the appropriate // handler based on their MessageType
func (s *Socket) handleMessagesIn() {
	for {
		m := <-s.messagesIn
		switch m.MessageType {
		case PLACE_ORDER:
			s.placeOrder(m.Payload)
		case CANCEL_ORDER:
			s.cancelOrder(m.Payload)
		case SIGNED_DATA:
			s.executeOrder(m.Payload)
		case DONE:
		default:
			panic("Unknown message type")
		}
	}
}
func ( s * Socket ) handleMessagesIn ( ) { for { m := <- s . messagesIn switch m . MessageType { case PLACE_ORDER : s . placeOrder ( m . Payload ) case CANCEL_ORDER : s . cancelOrder ( m . Payload ) case SIGNED_DATA : s . executeOrder ( m . Payload ) case DONE : default : panic ( " " ) } } }
handleMessagesIN listens on the messageIn channel and routes them to the appropriate
handler based on their MessageType
handleMessagesIN listens on the messageIn channel and routes them to the appropriate handler based on their MessageType