Page 91 - Python Cơ Bản
P. 91

8ϰS JMPI  client.py  ZЪM RШM HYRK FɱR HšЪM





           import socket



           s = socket.socket()

           host = '127.0.0.1'

           port = 12345



           s.connect((host, port))

           print s.recv(1024)

           s.close






          ɇSϰR GSHI XVɱR WЌ OЎX RРM чЎR QШX WSGOIX WIVZIV XLɺRK

          UYE LSWXREQI Pϴ] чšвG Xк TLš˜RK XLиG


           socket.gethostname()  Zɧ TSVX        7EY OLM OЎX RРM  WЌ


          LMВR XLК VE OЎX UYϲ XVϲ ZА Xк WIVZIV  7EY чɹ XLɳ чɹRK OЎX RРM
   86   87   88   89   90   91   92