Created
November 21, 2018 12:13
-
-
Save zerobell-lee/47d9691e75b723d9d781b0eb6b46d857 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from socket import * | |
port = 8080 | |
serverSock = socket(AF_INET, SOCK_STREAM) | |
serverSock.bind(('', port)) | |
serverSock.listen(1) | |
print('%d번 포트로 접속 대기중...'%port) | |
connectionSock, addr = serverSock.accept() | |
print(str(addr), '에서 접속되었습니다.') | |
while True: | |
sendData = input('>>>') | |
connectionSock.send(sendData.encode('utf-8')) | |
recvData = connectionSock.recv(1024) | |
print('상대방 :', recvData.decode('utf-8')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment