python-sockets Questions

3

Solved

There's a code I found in internet that says it gives my machines local network IP address: hostname = socket.gethostname() local_ip = socket.gethostbyname(hostname) but the IP it returns is 192.1...
Dichloride asked 14/10, 2020 at 7:52

4

I am learning about sockets in Python and came up with variable = socket.socket(socket.AF_INET, socket.SOCK_STREAM) I understood the function of this socket.socket and socket.AF_INET but I am cu...
Roofing asked 1/3, 2016 at 14:37

6

Solved

I am new to python. I want to get the ipaddress of the system. I am connected in LAN. When i use the below code to get the ip, it shows 127.0.1.1 instead of 192.168.1.32. Why it is not showing the ...
Void asked 22/3, 2019 at 9:31

4

How can I check if there is still connection from a specific ip address using python.
Zennas asked 29/5, 2013 at 8:16

5

Solved

I am creating a Messenger which is same as IP Messenger in Python 2.7 and Windows. I want the same functionality as IP Messenger uses in finding the systems running same software over LAN but I am...
Playbill asked 17/3, 2013 at 18:17

0

I've seen many questions about using raw TCP/UDP sockets in web browsers using JavaScript/Html5 however they are all old like this one posted 5 years ago. It is now 2021 and I'm wondering if there ...
Ostler asked 11/1, 2021 at 15:50

6

Solved

From the other posts on stack overflow this should be working import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("www.cnn.com" , 80)) s.sendall("GET / HTTP/1.1\r\n")...
Isisiskenderun asked 10/12, 2015 at 1:15

1

Solved

I am trying to send an image from my local computer to a computer in the cloud using asyncio with TCP protocol. Sometimes I get the entire image being sent and sometimes only part of the image gets...
Discretional asked 11/6, 2018 at 1:33

1

Solved

How can I make a coroutine stop with timeout? I don't understand why asyncio.wait_for() doesn't work for me. I have such piece of code (planning to make my implementation of telnet client): def e...
Demonism asked 30/1, 2017 at 9:19

2

I have a long running python script, launched with upstart. This script makes quite a lot of requests. Everything works well at first, however after a few hours I start permanently getting the foll...
Touchstone asked 26/12, 2011 at 8:45

2

Solved

I have just started learning python network programming. I was reading Foundations of Python Network Programming and could not understand the use of s.shutdown(socket.SHUT_WR) where s is a socket o...
Balliett asked 31/1, 2016 at 12:13

3

Solved

I want to check if api and app are running before running tests on them. I know I can get a list of open ports in CLI using sudo lsof -iTCP -sTCP:LISTEN -n -P But I want to write a python script...
Equerry asked 3/9, 2015 at 15:47

1

I'm trying to learn some python, and i'm having issues with the logic in what I want to test. Currently my code is written in a way that binding to source_address doesn't change when the proc...
Ultra asked 27/2, 2015 at 19:42

1

Solved

In the HTTP protocol you can send many requests in one socket using keep-alive and then receive the response from server at once, so that will significantly speed up whole process. Is there any way...
University asked 11/8, 2014 at 9:11

1

Solved

I am trying to reverse dns a list of IPs using socket.gethostbyaddr() in python, which returns 'Unknown Host' for some values, but using dig for the same ip returns the Hostname. Also, dig seems to...
Fluviomarine asked 20/10, 2011 at 7:2
1

© 2022 - 2025 — McMap. All rights reserved.