Home > other >  Own a client why always even not on your own server
Own a client why always even not on your own server

Time:09-25

 

The import socket, threading

S=socket. The socket (socket. AF_INET, socket. SOCK_STREAM) # create server

S.b ind ((30000) "192.168.0.101) # binding native IP

S.l isten (#) to monitor

While True:
C, addr=s.a ccept (#) received from the client connection; This method returns the two parameters, c, and the client scoke corresponding/communication scoket, addr on behalf of the client address
Print (addr)

C.s. end (" hello, this is the service side ". Encode (" utf-8 "))

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
The import socket

Client_socket=socket. The socket (socket. AF_INET, socket. SOCK_STREAM) # create a client

Client_socket. Connect ((30000) "192.168.0.101)

Print (client_socket. Recv (2048). The encode (" utf-8 "))

At the same time run in the python shell

CodePudding user response:

Firewall

The machine use 127.0.0.1 localhost, not through the firewall

CodePudding user response:

reference 1st floor tianfang response:

firewall
The machine use 127.0.0.1 localhost, without going through the firewall

I can't, is still the same error

CodePudding user response:

refer to the second floor qq_39321802 response:
Quote: refer to 1st floor tianfang response:

Firewall

The machine use 127.0.0.1 localhost, without going through the firewall

I can't, is still the same error


You is to run the server running the client again?

CodePudding user response:

reference 3/f, 5250 response:
Quote: refer to the second floor qq_39321802 response:

Quote: refer to 1st floor tianfang response:

Firewall

The machine use 127.0.0.1 localhost, without going through the firewall

I can't, is still the same error


You is to run the server running the client again?

yes
  • Related