473,748 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Xinetd & python server script. problem to get data from from client

Hello
I wrote simple script to test communication:
When i connect via telnet like: "telnet localhost 51423" the server is
working send and receive information. but when i connected to him via
client scrip so client script receive messages from server but server
doesn't receive message from client. In xinetd.conf and servers conf
file "only_from = 0.0.0.0/0" already choosen. What can i do?
Here below are my client and server:
Thank you :)

Server:

#!/usr/bin/env python
# example

import sys
import os

print "Wellcome"
print "please enter the string"
sys.stdout.flus h()
line = sys.stdin.readl ine().strip()
print "You entered %d characters." % len(line)
sys.stdout.flus h()

client:

import sys
import string
import os
import time
import socket
import popen2

PORT = 51423
HOST = ""#sys.argv[1]
sock = socket.socket(s ocket.AF_INET, socket.SOCK_STR EAM)
sock.connect((H OST, PORT))
print "Connected from:", sock.getsocknam e()
print "Connected to:",sock.getpe ername()
while 1:
print "waiting"
result = sock.recv(1024)
print result
sock.send('foo' )
print "Sent: foo"
if result == 3:
break

Jul 30 '07 #1
0 1259

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

Similar topics

0
1878
by: Harry George | last post by:
I'm trying to setup a SOAPpy service under xinetd. Has someone done this sort of thing? Didn't find it from google searches or documentation. This is probably a sockets-level issue, but I was hoping someone in python land had done this with SOAPpy before. The server works fine as simple SOAP server and client pair on localhost. But when I try to put it under xinetd, it fails. Using "xinetd -d" I can see it is failing due to address...
10
3690
by: Andrew Dalke | last post by:
Is there an author index for the new version of the Python cookbook? As a contributor I got my comp version delivered today and my ego wanted some gratification. I couldn't find my entries. Andrew dalke@dalkescientific.com
3
2670
by: Mick Turner | last post by:
I have connected to SQL Server database (server-side vbscript) and read some data from the tables. This works correctly. I now have the data in an array (server-side). I have to draw a line-chart based on that data, for which purpose I need to create client-side component (this works also perfectly). PROBLEM: I cannot use the server-side array for drawing the chart. Here's the code shortly:
4
6071
by: webdev | last post by:
lo all, some of the questions i'll ask below have most certainly been discussed already, i just hope someone's kind enough to answer them again to help me out.. so i started a python 2.3 script that grabs some web pages from the web, regex parse the data and stores it localy to xml file for further use.. at first i had no problem using python minidom and everything concerning
16
2922
by: Philippe C. Martin | last post by:
Hi, I am trying to change the data in a form field from python. The following code does not crash but has no effect as if "form" is just a copy of the original html form. Must I recreate the form order to do that ? My point is for the client to be able to re-read the modified data.
1
1973
by: Bestel | last post by:
I'm programming a little server with xinetd. This server wait for connections on the port 2000. When I write to stdout, it sends datas to the port 2000, and when I read from stdin, it read datas from 2000. When I write to stderr, it still send the informations on the port 2000, and I would like that they appears into a log file. I thougth that if we specified a log_type FILES in the xinetd server configuration, stderr would go to this...
12
3290
by: Jos Vos | last post by:
Hi, I'm trying to figure out how to implement a XML-RPC server that is called by xinetd i.s.o. listening on a TCP socket itself. I already have implemented a stand-alone XML-RPC server using SimpleXMLRPCServer, but I now want something similar, that is started via xinetd (i.e. reading/writing via stdin/stdout). Any hints or code examples?
0
5573
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
0
970
by: dalebryan1 | last post by:
I am working on a task to display a wireless network nodes using Google Earth (GE) with KML network links. I am using a simple python webserver (see code below) to serve up the python scripts as KML output to GE for this. import BaseHTTPServer import CGIHTTPServer class Handler(CGIHTTPServer.CGIHTTPRequestHandler): cgi_directories = httpd = BaseHTTPServer.HTTPServer(('',8000), Handler)
0
8991
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8831
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9548
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9325
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9249
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8244
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4876
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2215
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.