Scket connection to server

S

Steve Horsley

JudgeDread said:
hello python gurus

I would like to establish a socket connection to a server running a service
on port 29999. the host address is 10.214.109.50. how do i do this using
python?

many thanks

Off the top of my head (so there could be errors):

import socket
s = socket.Socket()
s.connect((10.214.109.50, 29999))
s.send("Hello, Mum\r\n")

That should point you in the right direction, anyway.

There is a higher level socket framework called twisted that
everyone seems to like. It may be worth looking at that too -
haven't got round to it myself yet.

Steve
 
J

JudgeDread

hello python gurus

I would like to establish a socket connection to a server running a service
on port 29999. the host address is 10.214.109.50. how do i do this using
python?

many thanks
 
?

=?ISO-8859-1?Q?Andr=E9_Egners?=

Steve said:
Off the top of my head (so there could be errors):

import socket
s = socket.Socket()
s.connect((10.214.109.50, 29999))
s.send("Hello, Mum\r\n")

That should point you in the right direction, anyway.

There is a higher level socket framework called twisted that everyone
seems to like. It may be worth looking at that too - haven't got round
to it myself yet.

Steve

Just curious...where do these messages show up @10.214.109.50?

andre
 
C

Christopher Subich

Steve said:
There is a higher level socket framework called twisted that everyone
seems to like. It may be worth looking at that too - haven't got round
to it myself yet.

I wouldn't say 'like,' exactly. I've cursed it an awful lot (mostly for
being nonobvious), but it does a damn fine job at networking, especially
if you're comfortable building your own protocols.
 
I

Irmen de Jong

Christopher said:
I wouldn't say 'like,' exactly. I've cursed it an awful lot (mostly for
being nonobvious), but it does a damn fine job at networking, especially
if you're comfortable building your own protocols.

If you want a communication library that *is* obvious and easy to use,
try Pyro http://pyro.sourceforge.net

--Irmen
 

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

Members online

Forum statistics

Threads
474,260
Messages
2,571,308
Members
47,955
Latest member
DarciAntho

Latest Threads

Top