Skip to content
Advertisement

Tag: sockets

python 3.6 socket pickle data was truncated

I can not send my numpy array in socket. I use pickle but my client pickle crashes with this error: pickle data was truncated My server : I create a numpy array and I want to send in my client with pickle (it’s work) My client He has my numpy array, but I can not load with pickle. I have

TypeError argument must be an int or have a fileno() method

Seen here https://stackoverflow.com/search?q=TypeError+argument+must+be+an+int+or+have+a+fileno%28%29+method But just can’t quite find my answer. I am trying out a chat script Server side runs perfectly fine. But client Has run from cmd, not IDLE because of issues (read something about it relating to my issue) Traceback Answer select doesn’t work with non-socket objects on Windows. For more information see the documentation about select.select, where

Socket Programming with Python server and Android client

I want to setup a socket interface. PC side runs a very simple socket server written in Python to test the connection: An Android client application will connect to PC: However, I cannot establish a connection between PC and Android device. Any idea to fix this? Answer As you haven’t detailed if you’re using either private or public IPs, it

Python. Redirect stdout to a socket

I run my script on computer “A”. Then I connect to computer “A” from computer “B” through my script. I send my message to computer “A” and my script runs it with an exec() instruction. I want to see the result of executing my message on computer “A”, through a socket on computer “B”. I tried to change sys.stdout =

Handling a timeout error in Python sockets

I am trying to figure out how to use the try and except to handle a socket timeout. The way I added the socket module was to import everything, but how do I handle exceptions? In the documentation it says you can use socket.timeouterror, but that doesn’t work for me. Also, how would I write the try exception block if

socket.error: [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissions

I’m trying to create a custom TCP stack using Python 2.6.5 on Windows 7 to serve valid http page requests on port 80 locally. But, I’ve run into a snag with what seems like Windows 7 tightened up security. This code worked on Vista. Here’s my sample code: C:python>python TestServer.py Traceback (most recent call last): File “TestServer.py”, line 19, in

How do I determine all of my IP addresses when I have multiple NICs?

I have multiple Network Interface Cards on my computer, each with its own IP address. When I use gethostbyname(gethostname()) from Python’s (built-in) socket module, it will only return one of them. How do I get the others? Answer Use the netifaces module. Because networking is complex, using netifaces can be a little tricky, but here’s how to do what you

Advertisement