getting error in socket connection

A

anuradha.k.r

hi,
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

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

#s.send('Hello, world')
#data = s.recv(1024)
s.close()
#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.
KRA.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top