By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,512 Members | 3,689 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,512 IT Pros & Developers. It's quick & easy.

getting error in socket connection

P: n/a
i have written a simple socket program in python to connect to a
windows machine.On the server side i am running a windows socket
program which works perfectly fine,my server program waites at
accept() for a connection to be established.on the client side however
i am not able to connect and am getting an error "10061 connection
refused".the code was directly downloaded from sites.
here is the code for client side:

import socket

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket.error:
print 'socket not creadted'
s.connect(("", 9999))
except socket.error,msg:
print 'error in connect'

#s.send('Hello, world')
#data = s.recv(1024)
#print 'Received', `data`

i am getting this error on debugging.Can anyone tell what the problem
could be?or is it that i will not be able to connect to awindows
machine or some funda like that.
pls help.
Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.