server side socket program hangs

Anthony McDonald tonym1972/at/club-internet/in/fr
Fri Sep 26 11:19:24 EDT 2003


<anuradha.k.r at sify.com> wrote in message
news:57efaf35.0309260215.5ddd5734 at posting.google.com...
> hi,
>    i am writing a socket program in python,both client side and server
> side.I've written the client side which is working perfectly
> fine(checked it against server program written in C).but as for my
> server program written in python it simply hangs.it does not show any
> error also.I've tried sample programs available .I don understand what
> the reason is as i am quite new to it.
> here is teh server side program:
>
> ///////////////////////
> from socket import *
> import socket
> import sys
>
> HOST = ''       #any address
> PORT = htons(9999)       #same port address as client
>
<snip code>
>
> can someone tell me what the problem is?

Your applying a function designed to simplyfy transfering IP addresses to a
literal value you want to use for your port.  The following should show the
effect thats now happening.

PythonWin 2.3.1 (#47, Sep 23 2003, 23:47:32) [MSC v.1200 32 bit (Intel)] on
win32.
Portions Copyright 1994-2001 Mark Hammond (mhammond at skippinet.com.au) - see
'Help/About PythonWin' for further copyright information.
>>> import socket
>>> socket.htons(9999)
3879
>>>

-- 
Anthony McDonald

This email address is protected by SpamBayes
www.spambayes.org






More information about the Python-list mailing list