Jim's
Tutorials

Spring 2018
course
site

April 18 - Jim

Code that Jim showed in his office.

# server terminal :
softmaple:Desktop mahoney$ python server.py 
sever: listening on 127.0.0.1:12468.
server: waiting for connection ...
server: connection from ('127.0.0.1', 58592):<socket.socket fd=4, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 12468), raddr=('127.0.0.1', 58592)>

server: waiting for connection ...
sgg got : 'b'Hi!\r\n''
sgg got : 'b'Are you there???\r\n''
sgg got : 'b"What's up?\r\n"'

And in another terminal window

# client terminal
Last login: Thu Apr 19 09:02:06 on ttys000
softmaple:~ mahoney$ telnet 127.0.0.1 12468
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
sgg: says 0
Hello!
sgg: says 1
Move over there!
sgg: says 2
Connection closed by foreign host.
softmaple:~ mahoney$ 


https://cs.marlboro.college /cours /spring2018 /jims_tutorials /web_tech /apr18_jim
last modified Tue April 16 2024 6:37 pm

attachments [paper clip]

  last modified size
TXT server.py Tue Apr 16 2024 06:37 pm 1.6K
TXT sgg.py Tue Apr 16 2024 06:37 pm 288B
TXT thread_demo.py Tue Apr 16 2024 06:37 pm 1.1K
TXT tictactoe.py Tue Apr 16 2024 06:37 pm 15K