Python Connect timeout 06-24-2014, 03:04 AM
#1
I've been trying to get into socket programming with python, but every time I try to connect. All i've tried so far is the generic
Could anyone give me some info as to some possible reasons why it may be unable to connect before timing out? I'm sure there are probably multiple possibilities. I'm pretty new to network programming so any help is appreciated.
Code:
>>> import socket
>>> socket.setdefaulttimeout(5)
>>> s = socket.socket()
>>> s.connect(("*insert ip address*",21))
>>> ans = s.recv(1024)
>>> print ans
(This post was last modified: 06-24-2014, 03:06 AM by nullzero.)


![[+]](https://sinister.li/images/modern/collapse_collapsed.png)
