alpersamur3
Hectopat
- Katılım
- 10 Mayıs 2020
- Mesajlar
- 156
Bu kodlar şöyle bir hata veriyor;
Kodlar;
. Şimdiden teşekkürler...
Python:
Traceback (most recent call last):
File "C:\Users\HP\Desktop\python\chatclient.py", line 22, in <module>
cli_sock.connect((HOST,PORT))
ConnectionRefusedError: [WinError 10061] Hedef makine etkin olarak reddettiğinden bağlantı kurulamadı
Kodlar;
Python:
import socket, threading
def gönder():
while True:
msg = raw_input('\nMe > ')
cli_sock.send(msg)
def receive():
while True:
sen_name = cli_sock.recv(1024)
data = cli_sock.recv(1024)
print('\n' + str(sen_name) + ' > ' + str(data))
if __name__ == "__main__":
# socket
cli_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# connect
HOST = 'localhost'
PORT = 5023
cli_sock.connect((HOST,PORT))
print('Yöneticiye bağlanılıyor...')
uname = raw_input('İsminizi girin')
cli_sock.send(uname)
thread_send = threading.Thread(target = send)
thread_send.start()
thread_receive = threading.Thread(target = receive)
thread_receive.start()
. Şimdiden teşekkürler...
Son düzenleyen: Moderatör: