We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • Practice
  • Certification
  • Compete
  • Career Fair
  • Hiring developers?
  1. Practice
  2. Distributed Systems
  3. Client Server
  4. UDS Echo Server
  5. Discussions

UDS Echo Server

Problem
Submissions
Leaderboard
Discussions

Sort 26 Discussions, By:

votes

Please Login in order to post a comment

  • rvbugs0 6 years ago+ 0 comments

    To what port number should be bind the server to ?

    20|
    Permalink
  • evanlarsen 5 years ago+ 0 comments

    aww.. where is the .NET love? c# or f#? or even javascript would be nice

    7|
    Permalink
  • kumaranSR4 3 years ago+ 0 comments

    Answer:

    Python

    def write_string_to_socket(connection, message): connection.send(message)

    def read_string_from_socket(connection): return connection.recv(1024)

    def process_client_connection(connection):

    while True:
        # read message 
        message = read_string_from_socket(connection)
    
        print "Message received = ", message
        sys.stdout.flush()
    
    
        if message == "END":
            break
        write_string_to_socket(connection, message)
    
    5|
    Permalink
  • xenomacx 6 years ago+ 0 comments

    Can you provide some helper functions for Java as for C/C++?

    5|
    Permalink
  • jklebes 4 years ago+ 0 comments

    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?

    4|
    Permalink
Load more conversations

Need Help?


View top submissions
  • Contest Calendar
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature