getting error in socket connection

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • anuradha.k.r@sify.com

    getting error in socket connection

    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(s ocket.AF_INET, socket.SOCK_STR EAM)
    except socket.error:
    print 'socket not creadted'
    try:
    s.connect(("130 .10.5.38", 9999))
    except socket.error,ms g:
    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.
Working...