Hello again Wilfried, A little extra data. My Data Available event handler grabs the number of waiting bytes in the queue from the RcvdCount property (I use it to size the receive buffer). If the byte count is 0, I just ignore the Data Available event. That is, I do nothing. I just added code to the Data Available event handler to add a line to my session log whenever I get a Data Available event where the RcvdCount is 0. I'm getting a ton of Data Available events where the RcvdCount is 0 on the plain vanilla TWSocket instance connected to the image streaming server. Any ideas what could cause that to happen?
Thanks, Robert --- On Fri, 6/5/09, robertoschler <robertosch...@yahoo.com> wrote: > From: robertoschler <robertosch...@yahoo.com> > Subject: Re: [twsocket] TWSocket stops receiving where TClientSocket just > keeps going > To: "ICS support mailing" <firstname.lastname@example.org> > Date: Friday, June 5, 2009, 7:43 PM > > Hello Wilfried, > > Thank you for your reply. > > It appears to be something with my application but I don't > know what. I grabbed your SocketSpy program and set it > up to act as a proxy between the streaming image server and > my program. Your log kept accumulating incoming data > from the server while my app, which was connected to > SocketSpy as an incoming client, stopped firing > DataAvailable() events after a certain number of received > frames, just as I described before. > > Now some details. My app is also a proxy server like > SocketSpy. I looked at the SocketSpy code and here is > the only crucial difference I could find between your code > and mine. When your server socket accepts a connection > you create a client socket that creates it's own REMOTE > client socket when a new connection is accepted. This > REMOTE client socket immediately connects to the other end > other end of the proxy link. From the client socket's > Data Available handler you immediately send the data to the > REMOTE socket and vice-a-versa. > > In my program when I accept a new connection with > TWSocketServer I just create a client socket. This > results in a message being posted to the host form telling > it a new client has been connected and the current > connection count. If the client count is now greater > than 0 for the first time, a single plain vanilla TWSocket > control then connects to the streaming image server > completing the other end of my proxy link. (Details on > why I use this architecture are below). > > To facilitate data transfer I use windows messages posted > to the host form. When *any* of the Clients to > TWSocketServer fire the Data Available event, I post a > message to the host form notifying it of the new data. > The host form then calls SendStr() on the single plain > vanilla TWSocket control connected to the image streaming > server. Conversely, when the plain vanilla TWSocket > control fires its Data Available event, a message is posted > to the host form who then sends the data to ALL clients > connected to the TWSocketServer instance. > > I do this so I can have a one-to-many proxy link, where > multiple clients can receive the image stream from the image > server. Also, I use the windows messaging technique > for safety purposes so that I am not trying to send large > amounts of data to the other end of the proxy link from > within the Data Available handler itself. By using > windows messages to trigger the sends I am moving the send > outside the scope of the Data Available handler. > > Note, I have code in *every* event handler for all sockets, > including for the Error and BgException events, and I am not > getting any error reports. I also check all > ErrorCode's on those events that provided that parameter, > and report any non zero code ErrorCode occurrences. > There have been no such occurrences. > > Do you have any ideas for tests or tips on trying to > diagnose why the Data Available event on the plain vanilla > TWSocket component connected to the image streaming server > would go dead after receiving successfully for a short > time? > > Thanks for your help, > Robert > > > --- On Fri, 6/5/09, Wilfried Mestdagh <wilfr...@mestdagh.biz> > wrote: > > > From: Wilfried Mestdagh <wilfr...@mestdagh.biz> > > Subject: Re: [twsocket] TWSocket stops receiving where > TClientSocket just keeps going > > To: "ICS support mailing" <email@example.com> > > Date: Friday, June 5, 2009, 3:30 AM > > Hello Robert, > > > > To be absolutely sure if it is the sending or > receiving > > application I > > suggest you put SocketSpy between it. You find it on > user > > made page. > > Then we are sure in wich application is a bug and we > can > > search deeper. > > > > --- > > Rgds, Wilfried [TeamICS] > > http://www.overbyte.be/eng/overbyte/teamics.html > > http://www.mestdagh.biz > > > > Thursday, June 4, 2009, 17:58, robertoschler wrote: > > > > > > > I have an application that opens an outgoing > > connection to an MJPEG > > > streaming server (server push using MIME > multi-part > > boundary method). > > > With my TWSocket code, I connect fine and then I > get > > an arbitrary > > > number of frames until the connection appears to > stop > > receiving data, > > > permanently. The data available event never > > fires again until I close > > > the connection and reconnect. This happens > > pretty quick. Sometimes > > > it's a small number of frames (e.g. - 1 to 7). > > Other times I get a > > > nice chunk of about 30 to 50 frames, but always > the > > data reception > > > just dries up. > > > > > To make sure the server was not stopping > transmission, > > I coded up a > > > simple example using the included Delphi 6 > > TClientSocket component. I > > > set it to non-blocking mode which is how I use > > TWSocket too. It did > > > not exhibit the problem. It kept receiving > > frames until I shut down > > > the connection. > > > > > How can I diagnose and or fix the problem with > my > > TWSocket code? I would prefer to use that instead. > > > > > Note: I am using Delphi 6 Pro and ICS version 5. > > > > > Thanks, > > > Robert > > > > > > > > > -- > > > To unsubscribe or change your settings for > TWSocket > > mailing list > > > please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket > > > Visit our website at http://www.overbyte.be > > > > -- > > To unsubscribe or change your settings for TWSocket > mailing > > list > > please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket > > Visit our website at http://www.overbyte.be > > > > > > -- > To unsubscribe or change your settings for TWSocket mailing > list > please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be > -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be