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

I

ilia.meerovich

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
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top