|
From: Jose E. S. <sua...@gv...> - 2008-06-25 07:33:26
|
In the client side, i ´ve two type of connecion : CONNECTION_TCP and
CONNECTION_TCP_PROXY.
CONNECTION_TCP runs, but CONNECTION_TCP_PROXY not...
El 24/06/2008, a las 15:04, Cedric Fontaine escribió:
> You can try to tandem on the jd3 server line and see what happens.
> You can run either jd3 in verbose mode
I see in the docs..
For debugging :
you can "tandem" on the phantom line to see the message print by the
subroutine
or start a tread with the -d option
but the debug mode only says..
:d3server -d
Serveur started on pid 0
Starting 2 threads...
One thread started on port 30000
Starting child with D3Client -port 30000 -s 0 -d
One thread started on port 30001
Starting child with D3Client -port 30001 -s 0 -d
Server ready on port 20002
New connection from 192.168.10.226
Connection client on 30000
I´ve reading the code i see this: (d3server line 287)
*------------------------------------------------------------
* Send the number of port to the client, if we got one
*------------------------------------------------------------
if next.port # "" then
if next.port < 0 then
buffer = "-":oconv(abs(next.port),"mr%7")
end else
buffer = oconv(next.port,'mr%8')
end
if debug then print "Connection client on ":next.port
%send(fd, buffer, 8 ,0)
end
if UnixHost then
%close(fd)
end else
%closesocket(fd)
end
well... this mean that the protocol closes the connection(therefore
runs correctly), sending first the new port to continue talking with
the client... but in the client side don´t respect this behaviour?
Reading the client side, I see that the ptype variable store the
integer 2,this is the CONNECTION_TCP_PROXY value...but the client side
dont´t manages this parameter
class D3Connection:
[...]
def __initTcp(self):
newport = self.__port
sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
# Try to get the port number of a D3Client
if self.__type == CONNECTION_TCP :
try:
sock.connect((self.__server,newport))
buf = sock.recv(8)
newport = int(buf) + 0
sock.close()
except:
print "Connection error to main server " +
self.__server + ":%i" % newport
return(D3_ERR)
self.__port = newport
try:
sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
sock.connect((self.__server,newport))
self.__socket = sock
except:
print "Connection error to D3Client " + self.__server + ":
%i" % newport
return(D3_ERR)
return(D3_OK)
[...]
What is the difference between CONNECTION_TCP and CONNECTION_TCP_PROXY?
Jose Ernesto Suarez
UPV- PoLinuX
http://www.polinux.upv.es
|