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
0
votes
0 answers

Bulk expired domains checker

I want to check a list of domains in a text file, whether they are registered or not. If they are not registered, I want to write those domains in another file. I wrote the code in python, but the main issue is that many registered domains are shown…
Joby
  • 1
  • 1
0
votes
1 answer

[CapNProto][pycapnp] Struct Send Server

How do I send a server a struct? I tried: import socket import sys import capnp import select import test_capnp class Test: def __init__(self, serverAddr="127.0.0.1", serverPort = 10000): self.serverAddress = (serverAddr, serverPort) …
Locu
  • 1
  • 1
0
votes
1 answer

If using sockets to pass sensitive data between two scripts in the same Tkinter app, over localhost, are there any security concerns?

I am implementing a socket in Python to pass data back and forth between two scripts running on the same machine as part of a single Tkinter application. This data, in many cases, will be highly sensitive (i.e. personal credit card numbers). Does…
user1318135
  • 717
  • 2
  • 12
  • 36
0
votes
1 answer

Not able to receive the packet as it is coming quickly in python

I am running a socket program in python to communicate with an Embedded Device. I am able to send the packet and get the response immediately, which I can verify it through Wireshark. The problem I am not able to capture it in the my code, but it I…
0
votes
1 answer

Error when running TCP Reverse shell

I'm very new to socket, and am currently taking an online course for offensive pen tests. One of the lessons is TCP Reverse shells. I am running two scripts on separate virtual machines (using VirtualBox), one being the attacker and another being…
Spiralio
  • 361
  • 1
  • 4
  • 15
0
votes
0 answers

List into Integer (Python 2.7)

port = [21, 22, 23, 24, 25, 80] s.connect((host, port)) The error I get is that an integer is required, how can i get the script to connect to the given ports?
0
votes
0 answers

Python socket handle multiple open connections

I need a way to handle multiple socket connections and keep the connection open (like JS socket.io do!). I will have 20 clients (machines) and a list of servers, each client need to establish a connection with each server and I cannot support this…
Denis V
  • 421
  • 4
  • 17
0
votes
0 answers

Paho-mqtt connect via ppp0

I am working on an embedded linux based device that runs ubuntu. Now the device driver for the wifi is really crappy so I cannot create a hotspot so this device connects to another device which is running a hotspot. Now I am connecting to that…
0
votes
1 answer

Beautifulsoup python error(10060)Emergency

i am new to programming , i have created a webscraper in python using beautiful soup but when i run this program it opens python command line and and just cursor blink on it and nothing happens...and now i receive these error TimeoutError: [WinError…
0
votes
0 answers

i cant close the client while am using the thread lock

this is the client code its work fine as a client but when i get out its show me an error this is the code import socket import threading tLock = threading.Lock() shutdown = False def receving(name, sock): while not shutdown: try: …
Mhadi Ahmed
  • 25
  • 1
  • 8
0
votes
0 answers

code.interact() doesn't understand arrow keys when stdin is set to a socket

I'm making a lightweight manhole-like remote interactive Python shell by setting stdin, stdout, stderr to a socket and then calling code.interact(). This works beautifully except for arrow keys showing up like ^[[C when I connect to it via nc…
Dmiters
  • 2,011
  • 3
  • 23
  • 31
0
votes
0 answers

Why will my multiprocessing Python script run on Linux, but encounter a pickle-related exception on Windows?

I have a feeling that this is related to the absence of fork() in Windows, but I'm not really sure what to do about it... I have a class called workObj, which inherits Process from multiprocessing. On Windows, creating a new instance of this class…
0
votes
1 answer

Python Iterate and Send Data Over Socket (Logstash/Elasticsearch)

I am attempting to stream JSON data and feed each individual JSON event (delimited by '\n') into a TCP socket that communicates with LogStash (localhost 5000). However, I can only seem to populate the last json object in Elasticsearch via LogStash.…
HectorOfTroy407
  • 1,737
  • 5
  • 21
  • 31
0
votes
1 answer

Python: how to pass UDP socket data to thread for processing

Bit of a python noob, but I was wondering … I want to start a thread on start up and pass udp socket data to the thread when it comes in for the thread to process AND then respond to the client accordingly. All the examples I have seen so far…
user4292309
0
votes
0 answers

Run Python chat client script in windows

i made a chat server and chat client python script the server runs on a port and as many as i like clients can connect and chat like an irc chatroom, works fine on linux, but not running on windows here is the chat client code import sys import…
Shantanu Bedajna
  • 559
  • 10
  • 34