Skip to content

Commit 2c4bef6

Browse files
committed
Move function call down
Signed-off-by: Daniel Andrei Minca <mandrei17@gmail.com>
1 parent 156643c commit 2c4bef6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

netcat.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ def main():
8585
client_sender(buffer)
8686

8787

88-
8988
def client_sender(buffer):
9089
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
9190

@@ -146,6 +145,9 @@ def server_loop():
146145
client_thread = threading.Thread(target=client_handler, args=(client_socket,))
147146
client_thread.start()
148147

148+
if listen:
149+
server_loop()
150+
149151

150152
def run_command(command):
151153
# trim newline

0 commit comments

Comments
 (0)