Discarding unsent data on tcl socket 
Author Message
 Discarding unsent data on tcl socket

Hi everyone,

We're using tcl sockets for implementing a distributed client-server
application,
tcl V7.6/itcl 2.2.

The Client is initialized by code  :

set sok [socket <ip_address> <server port>]
fconfigure $chId -buffering none -blocking 0

The problem occurs when we have already opened the socket and the server
machine becomes unreachable (a netware problem) and there is undelivered
data on the socket.

In this case the client declares a timeout after 3.5 minutes and closes
the socket.
However when the server once again becomes reachable,  even after
another 5 minutes,  the server receives the sent message and acts on the
message received.

If you have any idea how to solve the problem i.e. cause unsent data to
be discarded - we would
very grateful.

Thanks
Gabby



Sat, 15 Sep 2001 03:00:00 GMT  
 Discarding unsent data on tcl socket

Quote:

>  Hi everyone,

> We're using tcl sockets for implementing a distributed client-server
> application,
> tcl V7.6/itcl 2.2.

> The Client is initialized by code  :

> set sok [socket <ip_address> <server port>]
> fconfigure $chId -buffering none -blocking 0

> The problem occurs when we have already opened the socket and the
> server machine becomes unreachable (a netware problem) and there is
> undelivered data on the socket.

> In this case the client declares a timeout after 3.5 minutes and
> closes the socket.
> However when the server once again becomes reachable,  even after
> another 5 minutes,  the server receives the sent message and acts on
> the message received.

> If you have any idea how to solve the problem i.e. cause unsent data
> to be discarded - we would
> very grateful.

Timestamp the messages and discard if above a certain limit.  I would
also suggest adding keep alive messages.

--
+--------------------------------+---------------------------------------+

| Gerald W. Lester               | "The man who fights for his ideals is
|

|
|             Webmaster for http://www.luther95.net/MOLC-MLA
|
+--------------------------------+---------------------------------------+



Sat, 15 Sep 2001 03:00:00 GMT  
 Discarding unsent data on tcl socket

Quote:

> Hi everyone,

> We're using tcl sockets for implementing a distributed client-server
> application,
> tcl V7.6/itcl 2.2.

> The Client is initialized by code  :

> set sok [socket <ip_address> <server port>]
> fconfigure $chId -buffering none -blocking 0

> The problem occurs when we have already opened the socket and the
> server machine becomes unreachable (a netware problem) and there is
> undelivered data on the socket.

> In this case the client declares a timeout after 3.5 minutes and
> closes the socket.
> However when the server once again becomes reachable,  even after
> another 5 minutes,  the server receives the sent message and acts on
> the message received.

> If you have any idea how to solve the problem i.e. cause unsent data
> to be discarded - we would
> very grateful.

What about [close]ing the socket in that case ?
Doesn't it discard the unsent packets ?

-Alex



Sat, 15 Sep 2001 03:00:00 GMT  
 Discarding unsent data on tcl socket

Quote:


> > Hi everyone,

> > We're using tcl sockets for implementing a distributed client-server
> > application,
> > tcl V7.6/itcl 2.2.

> > The Client is initialized by code  :

> > set sok [socket <ip_address> <server port>]
> > fconfigure $chId -buffering none -blocking 0

> > The problem occurs when we have already opened the socket and the
> > server machine becomes unreachable (a netware problem) and there is
> > undelivered data on the socket.

> > In this case the client declares a timeout after 3.5 minutes and
> > closes the socket.
> > However when the server once again becomes reachable,  even after
> > another 5 minutes,  the server receives the sent message and acts on
> > the message received.

> > If you have any idea how to solve the problem i.e. cause unsent data
> > to be discarded - we would
> > very grateful.

> What about [close]ing the socket in that case ?
> Doesn't it discard the unsent packets ?

> -Alex

I do not think that it is that simple as the data may already have left
the clients machine. I think that you have to make your server cope with
it.

--
Paul Duffin

IBM UK Laboratories Ltd., Hursley Park nr. Winchester
Internal: 7-246880      International: +44 1962-816880



Sat, 15 Sep 2001 03:00:00 GMT  
 Discarding unsent data on tcl socket

Quote:

> The Client is initialized by code  :

> set sok [socket <ip_address> <server port>]
> fconfigure $chId -buffering none -blocking 0

> The problem occurs when we have already opened the socket and the
> server machine becomes unreachable (a netware problem) and there is
> undelivered data on the socket.

> In this case the client declares a timeout after 3.5 minutes and
> closes the socket.
> However when the server once again becomes reachable,  even after
> another 5 minutes,  the server receives the sent message and acts on
> the message received.

How are you detecting that the server has become unreachable?
Using eof?  It would appear that the data has already left control of Tcl
and been passed to the OS (since you've specified no buffering).
Does the server reboot, or simply become alive again after being comatose
for 5 mins?

Cheers,
Steve Ball



Sun, 16 Sep 2001 03:00:00 GMT  
 Discarding unsent data on tcl socket

Quote:



> > > Hi everyone,

> > > We're using tcl sockets for implementing a distributed client-server
> > > application,
> > > tcl V7.6/itcl 2.2.

> > > The Client is initialized by code  :

> > > set sok [socket <ip_address> <server port>]
> > > fconfigure $chId -buffering none -blocking 0

> > > The problem occurs when we have already opened the socket and the
> > > server machine becomes unreachable (a netware problem) and there is
> > > undelivered data on the socket.

> > > In this case the client declares a timeout after 3.5 minutes and
> > > closes the socket.
> > > However when the server once again becomes reachable,  even after
> > > another 5 minutes,  the server receives the sent message and acts on
> > > the message received.

> > > If you have any idea how to solve the problem i.e. cause unsent data
> > > to be discarded - we would
> > > very grateful.

> > What about [close]ing the socket in that case ?
> > Doesn't it discard the unsent packets ?

> > -Alex

> I do not think that it is that simple as the data may already have left
> the clients machine. I think that you have to make your server cope with
> it.

I had thought about this possibility, but I believe it is statistically
rare, because the Internet does routing at the IP level, not TCP (except
for HTTP proxies...). Hence, retransmits are done from the emitter
(end-to-end flow control). So, when the peer goes down and the TCP
retransmit delay goes up exponentially, the actual time spent in the net
by the packets becomes negligible wrt the delay itself. Hence the
probability to actually wipe out all 'sent' (at the C library level)
data converges pretty quickly towards 1.

-Alex



Sun, 16 Sep 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. How to discard data in stdin

2. NT Tcl socket vs. UNIX Tcl socket

3. how to post form data to a socket via tcl

4. hex data and Tcl sockets

5. data socket error: Can't connect to Data

6. TCL and Socket TO Socket

7. Tcl sockets development forum on Tcl Developer's Xchange

8. sockets/binary data

9. writing binary data to a socket?

10. two-way communication using Data Socket

11. data socket/ telnet connections

12. data sockets in a sun

 

 
Powered by phpBB® Forum Software