Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
BenChanlLOL authored May 12, 2024
1 parent 35aa7be commit 0ef28b5
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
# main.py
# Author: "BenChanlLOL" on github
# Name: ConCat
# Version: 0.2
# Version: 0.2.2
# link to github project: https://github.com/BenChanlLOL/ConCat

import socket
from sys import argv
import sys
import webbrowser
import time
import random

if len(argv) == 2:
print("no arguments are required")
sys.exit()


print("Welcome to ConCat")
num1 = random.randint(0, random.randint(0, 2048))
num2 = random.randint(0, random.randint(0, 2048))
num3 = random.randint(0, random.randint(0, 2048))
num4 = random.randint(0, random.randint(0, 2048))
session_code = str(num1 + num2 + num3 + num4)
print("session code is:", session_code)
#pre defined variables
sock = socket.socket()
serverOn = False
Expand Down Expand Up @@ -51,8 +59,16 @@
for n in range(0,5):
print(n)
time.sleep(1)
sock.bind((socket.gethostname(), 7092))
serverOn = True
try:
sock.bind((socket.gethostname(), 7092))
print("code 0")
finally:
serverOn = True
sock.listen(5)
print("listening")
conn, addr = sock.accept()
if sock.accept:
print(conn, addr)
print("starting on port 7092")
print("server started")
except OSError as e:
Expand Down Expand Up @@ -90,7 +106,7 @@

print("usage:\n" + usage)
elif cmd == "version" or "-v":
print("version: 0.1")
print("version: 0.2.2")
elif cmd == "troubleshoot":
print("If you are attempting to ssh using this client a BrokenPipeError is a indicator of wrong password"
"When Using SSH a small delay after the first message will occur, then echo the SSH version. "
Expand Down

0 comments on commit 0ef28b5

Please sign in to comment.