Skip to content
Advertisement

Delegating single function to client server in python

I have a simple client-server program using the xml-rpc protocol. My code is presented below. But this does not work as I expect it to. Maybe someone knows why?

In my module directed_graph there is function algorithm_dijkstra(vertex_name) that I want to execute on the server.

Client:

JavaScript

Server:

JavaScript

Small clarification:
In my module “directed_graph”, basically the functions that the client uses, but there is one that I want to perform on the server. I found that if all the functions are performed on the server, then the program works correctly. But how do I delegate only 1 function to the server and not all?

Advertisement

Answer

I solved the problem as follows. On the client, I set and store data for the graph, and on the server I perform only one function algorithm_dijkstra. And for everything to work correctly, need to make the second parameter for function algorithm_dijkstra, namely transfer the graph itself to this function, and not take the graph from somewhere like me tried to do before. And then everything works correctly and as expected.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement