Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python # This is server.py file
- import socket # Import socket module
- from marshal_function_converter import *
- def funkcija():
- print("Ovo je funkcija preneta preko mreze\n")
- s = socket.socket() # Create a socket object
- host = socket.gethostname() # Get local machine name
- port = 12345 # Reserve a port for your service.
- s.bind((host, port)) # Bind to the port
- k=function_to_string(funkcija)
- s.listen(5) # Now wait for client connection.
- while True:
- c, addr = s.accept() # Establish connection with client.
- print('Got connection from', addr)
- c.send(k)
- c.close() # Close the connection
Add Comment
Please, Sign In to add comment