Re: [twsocket] Socket flushing

2011-08-02 Thread Wilfried Mestdagh
://www.comfortsoftware.be http://www.expertsoftware.be > -Oorspronkelijk bericht- > Van: twsocket-boun...@elists.org [mailto:twsocket-boun...@elists.org] > Namens Éric Fleming Bonilha > Verzonden: maandag 1 augustus 2011 21:39 > Aan: 'ICS support mailing' > Onderwerp: Re

Re: [twsocket] Socket flushing

2011-08-01 Thread Éric Fleming Bonilha
augustus 2011 16:57 Aan: ICS support mailing Onderwerp: Re: [twsocket] Socket flushing Wilfried Mestdagh wrote: > Hi Eric, > >> Socket.Send(@Data[0], Length(Data)); >> Socket.Close; > > I think this is better: > >> Socket.Send(@Data[0], Length(Data)); >> Soc

Re: [twsocket] Socket flushing

2011-08-01 Thread Wilfried Mestdagh
cht- > Van: twsocket-boun...@elists.org [mailto:twsocket-boun...@elists.org] > Namens Arno Garrels > Verzonden: maandag 1 augustus 2011 16:57 > Aan: ICS support mailing > Onderwerp: Re: [twsocket] Socket flushing > > Wilfried Mestdagh wrote: > > Hi Eric, > > &g

Re: [twsocket] Socket flushing

2011-08-01 Thread Arno Garrels
Wilfried Mestdagh wrote: > Hi Eric, > >> Socket.Send(@Data[0], Length(Data)); >> Socket.Close; > > I think this is better: > >> Socket.Send(@Data[0], Length(Data)); >> Socket.Shutdown(1); This can be dangerous, Shutdown(1) disables sends on the socket, if not all has been sent yet you'll get a

Re: [twsocket] Socket flushing

2011-08-01 Thread Wilfried Mestdagh
Hi Eric, > Socket.Send(@Data[0], Length(Data)); > Socket.Close; I think this is better: > Socket.Send(@Data[0], Length(Data)); > Socket.Shutdown(1); This will send all data, telling the other end to signal to close when received. There is in your case no need to call the Flush method. -- mvg,

Re: [twsocket] Socket flushing

2011-08-01 Thread Éric Fleming Bonilha
If the reason that you call the Flush method is because you want to be sure all is sent before closing the socket then you can better call ShutDown(1) method. Yes, thats it, it is something like this Socket.Send(@Data[0], Length(Data)); Socket.Close; But I have found that if my data is small

Re: [twsocket] Socket flushing

2011-08-01 Thread Wilfried Mestdagh
Hi Arno, > Why? Do you have arguments? No, just something I recall, but it is very long time ago so I assume you are right. > I agree that Flush generally violates the async paradigm and > _might cause problems, however removing the call to MessagePump > should not make a difference. OK -- mv

Re: [twsocket] Socket flushing

2011-07-30 Thread Arno Garrels
Arno Garrels wrote: > Wilfried Mestdagh wrote: >> H Eric, >> >>> If I keep a loop like this >>> >>> while (FHSocket <> INVALID_SOCKET) and (not bAllSent) do >>> TryToSend; >>> >>> And TryToSend fails, will it fail everytime if I don´t call the >>> message pump? In this case an infinite loop wo

Re: [twsocket] Socket flushing

2011-07-30 Thread Arno Garrels
Wilfried Mestdagh wrote: > H Eric, > >> If I keep a loop like this >> >> while (FHSocket <> INVALID_SOCKET) and (not bAllSent) do >> TryToSend; >> >> And TryToSend fails, will it fail everytime if I don´t call the >> message pump? In this case an infinite loop would happen right? > > I think

Re: [twsocket] Socket flushing

2011-07-30 Thread Wilfried Mestdagh
Hi Eric, If the reason that you call the Flush method is because you want to be sure all is sent before closing the socket then you can better call ShutDown(1) method. -- mvg, Wilfried http://www.mestdagh.biz http://www.comfortsoftware.be http://www.expertsoftware.be -- To unsubscribe or change

Re: [twsocket] Socket flushing

2011-07-30 Thread Wilfried Mestdagh
H Eric, > If I keep a loop like this > > while (FHSocket <> INVALID_SOCKET) and (not bAllSent) do > TryToSend; > > And TryToSend fails, will it fail everytime if I don´t call the message > pump? In this case an infinite loop would happen right? I think so yes. -- mvg, Wilfried http://www.me

Re: [twsocket] Socket flushing

2011-07-29 Thread Éric Fleming Bonilha
upport mailing Onderwerp: Re: [twsocket] Socket flushing Nobody knows??? Eric -Mensagem Original- From: Éric Fleming Bonilha Sent: Friday, July 22, 2011 5:35 PM To: ICS support mailing Subject: Re: [twsocket] Socket flushing > What issues? It is a weird issue... it actually create

Re: [twsocket] Socket flushing

2011-07-27 Thread Wilfried Mestdagh
t; Van: twsocket-boun...@elists.org [mailto:twsocket-boun...@elists.org] > Namens Éric Fleming Bonilha > Verzonden: maandag 25 juli 2011 14:50 > Aan: ICS support mailing > Onderwerp: Re: [twsocket] Socket flushing > > Nobody knows??? > > Eric > > -Mensagem Origin

Re: [twsocket] Socket flushing

2011-07-25 Thread Arno Garrels
July 22, 2011 5:35 PM > To: ICS support mailing > Subject: Re: [twsocket] Socket flushing > >> What issues? > > It is a weird issue... it actually creates a stack overflow because > in some parts of my app I need to call flush, and flush calls the > messageloop and on mess

Re: [twsocket] Socket flushing

2011-07-25 Thread Éric Fleming Bonilha
Nobody knows??? Eric -Mensagem Original- From: Éric Fleming Bonilha Sent: Friday, July 22, 2011 5:35 PM To: ICS support mailing Subject: Re: [twsocket] Socket flushing What issues? It is a weird issue... it actually creates a stack overflow because in some parts of my app I need

Re: [twsocket] Socket flushing

2011-07-22 Thread Éric Fleming Bonilha
What issues? It is a weird issue... it actually creates a stack overflow because in some parts of my app I need to call flush, and flush calls the messageloop and on messageloop some timer routines are called that enters again on the same routine to flush the socket! it is complicated... and

Re: [twsocket] Socket flushing

2011-07-22 Thread Wilfried Mestdagh
> I´m having some issues with socket flushing due to the messageloop that What issues? > What is the purpose of calling MessagePump over here? Good question :) This dates from 1994... -- mvg, Wilfried http://www.mestdagh.biz http://www.comfortsoftware.be http://www.expertsoftware.be > -Oo