lessons period 2
This commit is contained in:
18
period_2/02-sockets/902/SocketUtil_t.py
Normal file
18
period_2/02-sockets/902/SocketUtil_t.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from TxBlock import *
|
||||
from Transaction import *
|
||||
from Signature import *
|
||||
|
||||
from SocketUtil import *
|
||||
|
||||
TCP_PORT = 5050
|
||||
BUFFER_SIZE = 1024
|
||||
SERVER = 'localhost'
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
server = newServerSocket(SERVER)
|
||||
print('A connection to the server is established.')
|
||||
Obj = recvObj(server)
|
||||
|
||||
print("Success! The connection is released.") # If returns after time, then successful
|
||||
server.close()
|
Reference in New Issue
Block a user