Sort 26 Discussions, By:
Please Login in order to post a comment
To what port number should be bind the server to ?
def write_string_to_socket(connection, message):
# read message
message = read_string_from_socket(connection)
print "Message received = ", message
if message == "END":
Can you provide some helper functions for Java as for C/C++?
Python: I had difficulty understanding what it wants me to do.
It simply wants you to define the methods read_string_from_socket, write_string_to_socket to call the appropriate methods on the socket. The socket is created, bound, etc for you and is passed to you as 'connection'.
The same thing (socket.send(), socket.recv(size)) works in Python 2 but not Python 3 - can someone tell me what has changed?