Questions tagged [python-sockets]

For questions related to the sockets module in the Python standard library, or more broadly socket programming in Python.

The Python library comes with a HOWTO document for sockets programming:

Socket Programming HOWTO — Python 3.x documentation

The standard library is well-documented:

socket - Low-level networking interface

Like the title suggests, sockets are the basic facility for network connections, and on Unix, several other types of interprocess connections. Beginners who want to use a particular application-level protocol should often try to find an existing higher-level library for that instead of programming directly with sockets.

506 questions
-1
votes
1 answer

python socket tcp server refuse connection

Hi there i was try to connect a client and a server using python socket... both the sides(client and server) are working without any error... Problem : When I try to connect the client to the server it gives the following error. Traceback (most…
4bh1
  • 182
  • 2
  • 13
-1
votes
2 answers

Please explain this Python based FTP server code

I was looking for FTP server implemented in Python and came across this https://gist.github.com/scturtle/1035886 . I tried to understand it but being a web developer and fairly new Python I found it confusing. Here's what I don't understand : From…
Shubham
  • 80
  • 2
  • 13
-2
votes
1 answer

Why does python socket server always send "None" while printing a value at the same time?

im setting up a local network game however when i attempt to send a packet size for unpicking a dictionary i keep getting None returned heres my server (stripped down to the not working portion) player1 = { # players 2-4 are the exact name but…
-2
votes
1 answer

TypeError: socket.bind() takes exactly one argument (2 given)

from socket import * def main (): print('''========================================================================== ''') print(''' [-] S T A R T I N G T H E D E C O Y S E R V E R [-] ''') …
-2
votes
1 answer

How I can connect to another computer using a socket?

I try this code: server: import socket s=socket.socket() ip='localhost' port=9999 s.bind((ip,port)) s.listen() print("wait for client...") c,addr=s.accept() print("client added!") while True: msg=input("your masage:>>>") …
-2
votes
2 answers

Socket Error : No connection could be made because targeted machine actively refused it

Note : This problem has been completely solved, as was am running client.py before server.py Just got started with socket programming, I have created the below code and expecting to print some byte message, but it isn't doing that. I just want to…
user11363434
-2
votes
1 answer

Syntax error when trying to run server.py through command prompt

This is the code i am trying to run import socket s = socket.socket() print ("Socket successfully created") port = 12345 s.bind(('', port)) print ("socket binded to %s" %(port)) s.listen(5) …
-2
votes
1 answer

Synchronizing socket programming python

I have a client-server application consisted of three rounds. At each round the client sends a file to the server, the server computes sth and send it back to the client. The client based on the received message prepares the message for the next…
curious
  • 1,524
  • 6
  • 21
  • 45
-4
votes
1 answer

'super' object has no attribute '__getattr__' kivy

I am writing a chat app using kivy and socket. However, whenever my app receives a message, I will always get an AttributeError: 'super' object has no attribute '__getattr__'. from kivy.app import App from kivy.lang import Builder from…
Brian Zheng
  • 439
  • 5
  • 18
-4
votes
2 answers

Checking if IP address is real - Getting ValueError: invalid literal for int() with base 10: '192.168.0.105'

I am attempting to make a chat room for a class project (I have stumped my teacher and he has given me permission to use any sources at my disposal, including asking Stack Overflow which some teachers don't allow). Before the user gets to the…
-5
votes
1 answer

socket.gaierror: Errno 11004 getaddrinfo failed

i am trying to create a proxy server script with python when i run it i have this arror messages please can i know what are the mistakes i've done and how to avoid them (i sow the script on a site) how the script looks like ! import socket from…
amine
  • 3
  • 3
1 2 3
33
34