New topic: 

[solved] IPCSocket issue

<http://forums.realsoftware.com/viewtopic.php?t=26172>

       Page 1 of 1
   [ 3 posts ]                 Previous topic | Next topic         Author  
Message       reets           Post subject: [solved] IPCSocket issuePosted: Fri 
Jan 23, 2009 2:08 pm                               
Joined: Sun Nov 18, 2007 11:19 am
Posts: 80
Location: New Brunswick, Canada              My app uses mutex to detect if 
it's already running. If it's not then it starts ipcsocket.listen and if it 
detects it is already running then it connects to it and sends data. The 
connection seems to work because the ipcsocket connected even triggers but 
nothing happens with the DataAvailable event.

Here is some code:
Connected event (this only triggers on the 2nd instance of the app that sends 
the data and then closes):
Code:
if app.Aborted = True then
  app.AppSocket.Write "tofront"
  app.AppSocket.Close
  Quit
end if



DataAvailable event:
Code:
MsgBox app.AppSocket.ReadAll



AppSocket is a class with Super of IPCSocket and is instantiated in the App 
open event.      

    Last edited by reets on Fri Jan 23, 2009 3:25 pm, edited 1 time in total.   
                            Top               npalardy           Post subject: 
Re: IPCSocket issuePosted: Fri Jan 23, 2009 2:34 pm                        
Joined: Sat Dec 24, 2005 8:18 pm
Posts: 4309
Location: Canada, Alberta, Near Red Deer              the app probably quits 
before all the data has actually been sent

poll the socket a couple times before the quit     
_________________
My web site Great White Software
RBLibrary.com REALbasic learning  
                            Top               reets           Post subject: Re: 
IPCSocket issuePosted: Fri Jan 23, 2009 3:25 pm                               
Joined: Sun Nov 18, 2007 11:19 am
Posts: 80
Location: New Brunswick, Canada              that worked. added a few polls in 
there and took out the app.appsocket.close completely.   
                            Top           Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 3 posts ]     

-- 
Over 900 classes with 18000 functions in one REALbasic plug-in. 
The Monkeybread Software Realbasic Plugin v8.1. 

&lt;http://www.monkeybreadsoftware.de/realbasic/plugins.shtml&gt;

[email protected]

Reply via email to