471,342 Members | 1,984 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,342 software developers and data experts.

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.flush()
line = sys.stdin.readline().strip()
print "You entered %d characters." % len(line)
sys.stdout.flush()

client:

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
sock.send('foo')
print "Sent: foo"
if result == 3:
break

Jul 30 '07 #1
0 1166

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Harry George | last post: by
10 posts views Thread by Andrew Dalke | last post: by
3 posts views Thread by Mick Turner | last post: by
4 posts views Thread by webdev | last post: by
16 posts views Thread by Philippe C. Martin | last post: by
1 post views Thread by Bestel | last post: by
12 posts views Thread by Jos Vos | last post: by
reply views Thread by dalebryan1 | last post: by
reply views Thread by rosydwin | last post: by

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.