1
나는이 소켓 클라이언트 Python3 코드에 붙어 :Python3 소켓 클라이언트는 16 진수 문자열 보내고받을 수
import socket
import codecs
def Main():
host = '127.0.0.2'
port = 502
mySocket = socket.socket()
mySocket.connect((host,port))
message = codecs.encode('\x00\x00\x00\x00\x00\x06\x01\x04\x00\x01\x00\x02')
mySocket.send(message)
data = codecs.decode(mySocket.recv(1024))
print ('Received from server: ' + data)
mySocket.close()
if __name__ == '__main__':
Main()
그것은 내가 Ananas에 연결하려고
File "C:\Python34\lib\encodings\utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb3 in position 11: invalid start byte
오류를 제공합니다 - 모드 버스/TCP -server
무엇이 오류입니까?
감사합니다.