I have found a slight problem in your forwarding
server. The problem is that disconnected clients are
not removed from the forwarding servers client list,
because you are not reacting to the closeconnection
exception from the receive object. If the same client
are reconnecting to the server, it will be 1 working
and 1 not working client connector in the client list
of the forwarding server. If the same client is
connecting/disconnecting a lot of times, there will be
a long list of the same client in the list but only
the last one is working. To fix this problem I have
come up with this solution:
I have edited a little in the forwarding server to
correct this problem.
Change the constructor of the Client.cs of the
ForwarderServerLib to this:
public Client(Socket client, Stream strm, Listener
listener)
{
this.client=client;
this.listener=listener;
this.strm = strm;
snd = new ObjectSender(this.strm);
rcv = new ObjectReceiver(this.strm, snd);
rcv.OnObjectReceived+=new ObjectReceived
(rcv_OnObjectReceived);
rcv.ConnectionClosed += new EventHandler
(rcv_ConnectionClosed);
rcv.Start();
}
and add this event handler for the connection closed
event:
public void rcv_ConnectionClosed(object sender,
EventArgs e)
{
Close();
this.listener.RemoveClient(this);
}
in the Listener.cs for the ForwarderServerLib add this
function:
public void RemoveClient(Client client)
{
connections.Remove(client);
}
Kjetil
Logged In: YES
user_id=1307540
Thanks, I'll fix it in a next release.