Skip to content

Commit

Permalink
TCP socket
Browse files Browse the repository at this point in the history
  • Loading branch information
hunryzh2003 committed Nov 20, 2014
1 parent dda3f52 commit 9668fa7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import socket
import re

s = socket.socket()
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
host = socket.gethostname()
port = 12345

Expand Down
4 changes: 2 additions & 2 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import time
import socket

s = socket.socket()
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
host = socket.gethostname()
port = 12345
s.bind((host, port))
Expand All @@ -19,4 +20,3 @@
c.send('PONG ' + time_s)
break
c.close()
break

0 comments on commit 9668fa7

Please sign in to comment.