Python Forum
socket.connect question about parenthesis
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
socket.connect question about parenthesis
#2
The answer is simple, the method socket.connect.connect() takes a single argument, the address where the socket should connect. For a socket of the AF_INET family type (the default), the address is a tuple with two elements (host, port). So you are not using double parentheses, you are passing a single argument which is a tuple.
Reply


Messages In This Thread
socket.connect question about parenthesis - by pace - Jan-27-2021, 04:18 PM
RE: socket.connect question about parenthesis - by Gribouillis - Jan-30-2021, 08:17 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  python socket connect only sometimes espDino 0 1,542 Jul-15-2020, 12:13 PM
Last Post: espDino
  Socket won't connect, giving me a typeerror GalaxyCoyote 1 3,415 Apr-07-2020, 10:28 AM
Last Post: Mateusz
  Question concerning function of a a socket pkm 4 3,874 Jun-04-2019, 07:48 AM
Last Post: DeaD_EyE
  UDP Socket Basic question zeeshannnetwork 2 3,136 Sep-10-2018, 02:25 AM
Last Post: zeeshannnetwork

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020