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 Sun December 22 2024 5:00 am

attachments [paper clip]

  last modified size
TXT server.py Sun Dec 22 2024 05:00 am 1.6K
TXT sgg.py Sun Dec 22 2024 05:00 am 288B
TXT thread_demo.py Sun Dec 22 2024 05:00 am 1.1K
TXT tictactoe.py Sun Dec 22 2024 05:00 am 15K