public void Begin() { try { var handler = new MultiplicationHandler(); var processor = new MultiplicationService.Processor(handler); TServerTransport serverTransport = new TServerSocket(Port); _server = new TSimpleServer(processor, serverTransport); Console.WriteLine("Starting the server..."); // The next call will ... // ... create a new thrift server on a new thread (Thrift design) // ... that thread runs till server.Stop() is called // ... this thread is blocked till then _server.Serve(); } catch (Exception ex) { Console.WriteLine(ex); } Console.WriteLine("Server, done."); }
private static double[][] MatrixMultiply(double[][] matrixA, double[][] matrixB, MultiplicationHandler MultiplicationHandler) { // do error checking here var Arows = matrixA.Length; var Acols = matrixA[0].Length; var Brows = matrixB.Length; var Bcols = matrixB[0].Length; if (Acols != Brows) { throw new Exception(); } double[][] result = MatrixCreate(Arows, Bcols); MultiplicationHandler(matrixA, matrixB, result, Arows, Acols, Bcols); return(result); }