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$ 


attachments [paper clip]

  last modified size
TXT server.py Thu Jul 25 2024 01:20 am 1.6K
TXT sgg.py Thu Jul 25 2024 01:20 am 288B
TXT thread_demo.py Thu Jul 25 2024 01:20 am 1.1K
TXT tictactoe.py Thu Jul 25 2024 01:20 am 15K