Eric Brunel <eric.brunel at pragmadev.N0SP4M.com> wrote in message news:<bkroq8$8ud$1 at news-reader1.wanadoo.fr>...
Nick Keighley wrote:
I'm probably missing something rather obvious, but is there a known
problem with getting a Python based socket program to communicate with
a C based socket program? A simple echo server written in Python
(the example from Python in a Nutshell actually) will happily talk
to a Python based client. If a C based client is substitued the connection
is refused (or so the C client reports). The C client will talk to
a C server.
Communications between C and Python via sockets definetly work: we do that
every day (no kidding ;-)

Can you post an example of your code?
by the time you read this the posted code may have appeared.
A call to htons() (convert unsigned short to network byte order)
was ommitted on the C side.

this line:-
sin.sin_port = PORT;

should read:-
sin.sin_port = htons(PORT);


Nick Keighley

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 6 of 9 | next ›
Discussion Overview
grouppython-list @
postedSep 24, '03 at 9:13a
activeSep 26, '03 at 5:03a



site design / logo © 2022 Grokbase