Subj : Proxy Service Issues
To   : Digital Man
From : Drakmir
Date : Fri Oct 07 2005 12:50 am

 Re: Proxy Service Issues
 By: Drakmir to Digital Man on Thu Oct 06 2005 11:38 pm

>   Re: Proxy Service Issues
>   By: Drakmir to Digital Man on Thu Oct 06 2005 11:25 pm
>
>  >   Re: Proxy Service Issues
>  >   By: Digital Man to Drakmir on Thu Oct 06 2005 07:44 pm
>  >
>  > I hadn't seen that one.  I'll take a look at it and see if it works for m
>  > application.  :)
>  >
>  > That proxy is slow because I removed block read/write since I wasn't sure
>  > was going wrong.  It was the simpliest example I could get to fail and no
>  > down the computer with it.
>  >
>  > Thanks again!
>  >
>  > Alan
> So, I adapted socktest to read from client.socket instead of console, and fo
> some reason it won't read the input.  I basically just changed the RAW mode
> inkey for the same if logic above (client.socket.data_waiting).
>
> Is there a socket option that has to be set or something?
>
> Alan
The following code has the issue above (no read of the client socket for some
reason):

   while(socket.is_connected && client.socket.is_connected)
   {
       if(socket.data_waiting)
       {
           buf = socket.read();
           client.socket.write(buf);
           continue;
       }

       if(client.socket.data_waiting)
       {
           buf = client.socket.read();
           socket.write(buf);
           continue;
       }
       sleep(1);
   }

Changing it to:

   while(socket.is_connected && client.socket.is_connected)
   {
       if(socket.data_waiting)
       {
           buf = socket.readBin(1);
           client.socket.writeBin(buf, 1);
           continue;
       }

       if(client.socket.data_waiting)
       {
           buf = client.socket.readBin(1);
           socket.writeBin(buf, 1);
           continue;
       }
       sleep(1);
   }

Causes the crash condition.  I know I switched to readBin/writeBin when I had
problems with read/write interpreting something I didn't want it to interpret.
Not sure of the specifics anymore, so I'll try with read/write again some more
to see if I can figure out a combination that allows for both read and write.

Alan

---
� Synchronet � Holodeck One - bbs.holodeckone.com