File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 88from rsa_encryption_gui .rsa_encryption import PublicKey
99
1010
11- def run (host_ip = raw_input ('Enter Host IP Address: ' )):
11+ def run (host_ip = raw_input ('Enter Host IP Address: ' ), port = raw_input ( 'Enter port number: ' ) ):
1212 data_file = open (os .path .join (os .path .dirname (__file__ ), 'Message/Message_to_encrypt.txt' ), "r" )
1313 out = open (os .path .join (os .path .dirname (__file__ ), 'Message/encrypted_text.txt' ), "r+" )
1414 data = list ()
@@ -24,7 +24,7 @@ def run(host_ip=raw_input('Enter Host IP Address: ')):
2424 s = socket .socket (socket .AF_INET , socket .SOCK_STREAM )
2525
2626 # Use the same port number as the host
27- port = 1234
27+ port = port
2828 s .connect ((host_ip , port ))
2929 print "Connected to socket"
3030
Original file line number Diff line number Diff line change 1111s = None
1212
1313
14- def create_socket ():
14+ def create_socket (port = raw_input ( "Enter port number: " ) ):
1515 global s
1616 # Get the local IP over LAN.
1717 host = socket .gethostbyname (socket .gethostname ())
1818
1919 print "host IP:" , host
20- port = 1234 # Use port number that's not in use.
20+ port = port # Use port number that's not in use.
2121
2222 s = socket .socket (socket .AF_INET , socket .SOCK_STREAM )
2323 s .setsockopt (socket .SOL_SOCKET , socket .SO_REUSEADDR , 1 )
You can’t perform that action at this time.
0 commit comments