Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Nov 19, 2018 3:42 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: IPC Socket
PostPosted: Fri Sep 30, 2005 9:33 am 
Offline

Joined: Fri Sep 30, 2005 8:47 am
Posts: 100
I have a IPCSocket comms between two applications (once is a service application and the other provides the UI for this application, like running status and progress bar etc).

This is the code I have in the Error event:

UISocket.Close

if UISocket.LastErrorCode = 102 then
Msgbox "The connection to the Daemon has been unexpectedly terminated. Maybe the service has crashed. Please try again later."
quit
end if

But unfortunately this doesnt work correctly when I open the taskbar and end the service process. Why ?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Sep 30, 2005 9:34 am 
Offline

Joined: Fri Sep 30, 2005 8:47 am
Posts: 100
What a waste of time :-)

Just found out that the UISocket.Close sets the last error code to 0.

Just changed it to :

if UISocket.LastErrorCode = 102 then
Msgbox "The connection to the Daemon has been unexpectedly terminated. Maybe the service has crashed. Please try again later."
quit
end if
UISocket.Close


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Sep 30, 2005 9:59 am 
Offline

Joined: Fri Sep 30, 2005 9:24 am
Posts: 35
talk2sk wrote:
What a waste of time :-)

Just found out that the UISocket.Close sets the last error code to 0.

Just changed it to :

if UISocket.LastErrorCode = 102 then
Msgbox "The connection to the Daemon has been unexpectedly terminated. Maybe the service has crashed. Please try again later."
quit
end if
UISocket.Close


In fact, by the time you get .Error, the socket is usually already closed. There's no need to call ".Close" in the Error event.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group