팅프로그래밍 클라이언튼데,


도대체 왜 


41번째 줄이 오류라고 하냐.ㅠㅠㅠㅜㅠ

s.connect((serverHost,serverPort)) #서버 접속 이부분임.ㅠㅠㅠㅠㅠㅠ


import sys

from threading import Thread

from socket import * 


Ver = '1.0.1'


serverHost = ''# 접속 주소

serverPort = 12345            # 포트



def handler(socket):

    while 1:

               #입력버퍼 (수신용 1024바이트)

        if not data:                    #공백일때 반환

            continue

        if 'End Client':        #서버에서 모든 클라이언트 종료 (Disconnect)

            print ("All Out")

            socket.close()

            print ('Server is Outof All Client')

            print ('Please press any key to continue...')

            break

        if End':              #서버에서 벤

            socket.close()              #소캣종료

            print ('Server is Disconnect')

            print ('Please press any key to continue...')

            break

        print (data)

        

Msg = input('Use Name :')


s = socket(AF_INET, SOCK_STREAM)    #소켓 생성 TCP/IP 다

s.connect((serverHost,serverPort)) #서버 접속

s.send(Msg)                         #이름설정

print ('Connect!')

hTread = thread.start_new_thread(handler, (s, ))      #스레드 생성


while 1:        #메세지 입력을 위한 루프

    Msg = input('>')

    if Msg == '/x':

        s.send('/x')

        break

    try:

        s.send(Msg)

    except:

        break

try:

    s.close()

except:

    pass

print ('End Chat')