Skip to content

Commit 6181583

Browse files
committed
Update to v0.92
Fixed major bugs and improved the efficiency of the code
1 parent 18d0924 commit 6181583

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

server.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
## Example use of tcp v0.91 ##
1+
## Example use of tcp v0.92 ##
22
## R. M. Jones ##
33
## 01/07/2017 ##
44

55
import tcp #imoprts the module that is included with this file
66

7-
def server():
7+
def server(BUFFER_SIZE, TCP_IP=tcp.getmyip(), TCP_PORT=5050):
88

99
data =0
10-
TCP_IP = tcp.getmyip() #Gets your private ip address
11-
TCP_PORT = int(input("Enter port: ")) #The port that will be open
10+
#TCP_IP = tcp.getmyip() #Gets your private ip address
11+
#TCP_PORT = int(input("Enter port: ")) #The port that will be open
1212
BUFFER_SIZE = 20 # Normally 1024, but we want fast response
1313

1414
conn = tcp.bind(TCP_IP, TCP_PORT)
@@ -24,7 +24,7 @@ def server():
2424
if __name__ == "__main__":
2525
info = 0
2626
while info != "stop":
27-
info, s = server()
27+
info, s = server(20)
2828
print(info)
29-
tcp.send(data, s)
29+
tcp.send(info, s)
3030
s.close()

0 commit comments

Comments
 (0)