473,503 Members | 544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Scket connection to server

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
Jul 19 '05 #1
6 1533
The documentation gives an excellent example on how to do this, see
http://docs.python.org/lib/socket-example.html

Jul 19 '05 #2
JudgeDread wrote:
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
Jul 19 '05 #3
Steve Horsley wrote:
JudgeDread wrote:
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


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

andre

--
Nothing is easier than being busy -
and nothing more difficult than being effective.
Jul 19 '05 #4
On 2005-06-30, André Egners <an**********@rwth-aachen.de> wrote:
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")


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


Um, at port 29999?

--
Grant Edwards grante Yow! does your DRESSING
at ROOM have enough ASPARAGUS?
visi.com
Jul 19 '05 #5
Steve Horsley wrote:
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.
Jul 19 '05 #6
Christopher Subich wrote:
Steve Horsley wrote:
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.


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

--Irmen
Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
1997
by: Fortepianissimo | last post by:
Here is the situation: I want my server started up upon connection. When the first connection comes in, the server is not running. The client realizes the fact, and then starts up the server and...
2
3912
by: Dicky Cheng | last post by:
Hi, I am using .net remoting technology. I set up a .net remoting client and server in IIS. When the client calls the server, the server will run a long duration method (30-60seconds). I have a...
5
8721
by: Fred Zuckerman | last post by:
Hello All, After reading in this group about the preference for connecting to a SQL Server using a connection string instead of a DSN file, I have done just that. BUT, I cannot update my data....
12
1314
by: RKay | last post by:
I have a Win2k server running SQL Server 2000. On that box I built a working web service that pulls data from the database. One of the services available simply accepts an ado.net connection string...
0
3900
by: Suresh | last post by:
Hi Guys I have Db2 server installed on remote server. i am connecting to that remote server by using VPN. I want to connect that remote DB2 server instance using my local machine DB2...
14
6995
by: Marcus | last post by:
I have a function that simply returns TRUE if it can connect to a particular Sql Server 2005 express, or FALSE if it cannot. I am getting some strange error codes returned when the computer that...
25
14461
by: _DD | last post by:
I'd like to include a 'Test Connection' button in an app, for testing validity of a SQL connection string. I'd prefer to keep the timeout low. What is the conventional way of doing this?
17
2632
by: Anil Gupte | last post by:
I am using the following to try to connect to the database, but it does not seem to be working. Dim sConnString sConnString = "Provider=SQLNCLI.1;Integrated Security=SSPI;Persist Security...
39
5823
by: alex | last post by:
I've converted a latin1 database I have to utf8. The process has been: # mysqldump -u root -p --default-character-set=latin1 -c --insert-ignore --skip-set-charset mydb mydb.sql # iconv -f...
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7281
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7334
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7462
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5579
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
383
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.