Created
January 16, 2022 03:57
-
-
Save Park-Developer/c7bbc4161a810e783cf66ff89ad4a5ed to your computer and use it in GitHub Desktop.
Python TCP Client
This file contains 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 * | |
clientSock = socket(AF_INET, SOCK_STREAM) | |
clientSock.connect(('169.254.42.23', 5100)) | |
print('연결 확인 됐습니다.') | |
clientSock.send('I am a client'.encode('utf-8')) | |
#print('메시지를 전송했습니다.') | |
data = clientSock.recv(1024) | |
print('받은 데이터 : ', data.decode('utf-8')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment