# Sends the modified message to the clientĬnd(modifiedMessage.encode())ĬonnectionSocket. # Closes the server if the message is "exit" Print("The server is ready to serve.") # Prints the server is runningĬonnectionSocket, clientAddress = serverSocket.accept() ServerSocket.listen(1) # Listens to one connection on the "handshake socket" # Assigns the serverPort to the server socket ServerSocket = socket(AF_INET, SOCK_STREAM) For example, suppose we were attempting to configure an IP address on a router interface. ![]() ![]() # Opens the socket, AF_INET: IPv4 | SOCK_STREAM: TCP socket The indicates the first instance of an error in the line typed in. ServerPort = 3125 # Defines the port this socket will be listening The code below works well on my machine however, when I try to run this very same code on a virtual server created on the Cisco Packet Tracer (programming interface on the server), it returns the error: NotImplementedError: socket is not yet implemented in Skulpt in file src/lib/socket.py on line 1 from socket import * The code is for opening a socket for a TCP connection with a client only to get a string, set it to uppercase and send the modified string back to the client. ![]() I am trying to run a simple python script on the Cisco Packet Tracer for testing.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |