@@ -45,14 +45,6 @@ def receive_data(conn):
4545 return (data_id , payload )
4646
4747
48- # define category in which you would like to define data
49- data_identifiers = {"info" : 0 , "data" : 1 , "image" : 2 }
50- # key to be trusted by server
51- key_message = "C0nn3c+10n"
52- # a sample dictionary data
53- data = {"data number" : 0 , "message" : "A new message has been arrived from client" }
54-
55-
5648def main (config ):
5749 # create client socket object and connect it to server
5850 conn = socket .socket (socket .AF_INET , socket .SOCK_STREAM )
@@ -70,10 +62,6 @@ def main(config):
7062 sys .exit ()
7163 while True :
7264 try :
73- # send dict
74- data ["data number" ] += 1
75- send_data (conn , data , config ["data_identifiers" ]["data" ])
76- print (receive_data (conn )[1 ])
7765 # send image
7866 ret , frame = cap .read ()
7967 if not ret :
@@ -88,7 +76,7 @@ def main(config):
8876 if config ["client" ]["grayscale" ]:
8977 frame = cv2 .cvtColor (frame , cv2 .COLOR_BGR2GRAY )
9078 send_data (conn , frame , config ["data_identifiers" ]["image" ])
91- print (receive_data (conn )[1 ])
79+ # print(receive_data(conn)[1])
9280 except KeyboardInterrupt :
9381 print ("\n [INFO]: Keyboard Interrupt received" )
9482 # once keyboard interrupt is received, send signal to server for closing connection
0 commit comments