Example #1
0
        public void Response(Messages.Response response)
        {
            Messages.Communication comm = new Messages.Communication();

            comm.Type     = Messages.Communication.CommunicationType.Response;
            comm.Response = response;

            byte[] serialized = Messages.Messages.Create(comm);

            if (serialized != null)
            {
                d_client.GetStream().Write(serialized, 0, serialized.Length);
            }
        }
        protected bool WriteResponse(Optimization.Messages.Response response)
        {
            Messages.Communication comm = new Messages.Communication();

            comm.Type     = Messages.Communication.CommunicationType.Response;
            comm.Response = response;

            byte[] ret = Messages.Messages.Create(comm);

            if (ret != null)
            {
                Console.OpenStandardOutput().Write(ret, 0, ret.Length);
                Console.OpenStandardOutput().Flush();
                return(true);
            }

            return(false);
        }