By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,932 Members | 1,944 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,932 IT Pros & Developers. It's quick & easy.

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

P: n/a
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 =" already choosen. What can i do?
Here below are my client and server:
Thank you :)


#!/usr/bin/env python
# example

import sys
import os

print "Wellcome"
print "please enter the string"
line = sys.stdin.readline().strip()
print "You entered %d characters." % len(line)


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

PORT = 51423
HOST = ""#sys.argv[1]
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((HOST, PORT))
print "Connected from:", sock.getsockname()
print "Connected to:",sock.getpeername()
while 1:
print "waiting"
result = sock.recv(1024)
print result
print "Sent: foo"
if result == 3:

Jul 30 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.