Article delegate-en/2331 of [1-5169] on the server localhost:119
  upper oldest olders older1 this newer1 newers latest
search
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]

Newsgroups: mail-lists.delegate-en

[DeleGate-En] Can Delegate do this?
08 Jul 2003 13:22:59 GMT Commander Smutticus <pdeeqbdyi-i3inxhpumzfr.ml@ml.delegate.org>


A colleague of mine wrote a program in python to do what I need.  Here's
the script.  Sorry for the noise.

# Echo server program

import socket
import telnetlib

HOST = 'somehost'    # The remote host
s1 = telnetlib.Telnet(HOST, someport)

HOST = ''                 # Symbolic name meaning the local host
PORT = somelistenport     # Arbitrary non-privileged port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))
s.listen(1)

while 1:
     conn, addr = s.accept()
     conn.setblocking(0)
     print 'Connected by', addr
     while 1:
              print "1"
              try:
                   data = conn.recv(1024)
                   if not data: break
              except:
                   data = ""

              s1.write(data)
              data2 = s1.read_very_eager()
              conn.sendall(data2)
     conn.close()
s1.close()

--Smutt

-- REPLYING TO THE FOLLOWING MESSAGE --
From: Commander Smutticus <pdeeqbdyi-i3inxhpumzfr.ml@ml.delegate.org>
Date: 08 Jul 2003 10:55:12 GMT
Message-ID: <_A2329@delegate-en.ML_>
--
Is it possible for me to use Delegate to manage the state of a TCP
connection?
I want to use PHP to poll a telnet connection.  My PHP script would post
data to delegated and get a response from telnetd.  This could be
over TCP or HTTP/TCP.  The socket between telnetd and delegated would be
a normal TCP socket.  While the socket between PHPscript and delegated
could only be initiated by PHPscript and would always consist of the
following series similar to HTTP 1.0:
1.  Setup by PHPscript
2.  Post from PHPscript
3.  Response from delegated
4.  Teardown
(PHPScript)---Stateless--->(delegated)<---TCP--->(telnetd)
More info:
I'm planning on writing a VoiceXML interface in PHP to some popular Multi
User Dungeons(MUDs) on the internet.  I wrote a prototype many months
ago that used www.phpzork.com as the MUD.  But that site has been down for
a long time now and I can't find any other stateless MUD's.
Thanks,
Smutt

  admin search upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
@_@V