It seems that under cocoa if I have a modal window open (opened with .showmodal) and I have an open easyTCPsocket that is listening, its receivedMessage event will not fire until the window is closed.
[quote=199058:@James Meyer]It seems that under cocoa if I have a modal window open (opened with .showmodal) and I have an open easyTCPsocket that is listening, its receivedMessage event will not fire until the window is closed.
Is this a bug or correct behavior?[/quote]
From what I see, showmodal does not stop a Thread, so that may be the solution for your listening socket.
More info: My situation is basically this: I have a .showModal window open… it includes a button that when clicked executes a easyTCPSocket.SendMessage()… that message is received by another app which in turn sends another message back.
After some more testing it appears that my problem is that the easyTCPSocket.SendMessage() does not actually send the message until the .showModal window is dismissed. If I simply .show the window instead of .showModal the message is sent and the reply is received OK.
Is this expected behavior? Should .showModal block the socket from sending?
Yes, but not because it should code execution stops until the window is hidden or closed. So if the SendMessage command is placed after ShowModal it will of course not be called prior to the closing of the window. I would override ShowModal and call SendMessage in there followed by Super.ShowModal.
[quote=199169:@James Meyer]I have a .showModal window open… it includes a button that when clicked executes a easyTCPSocket.SendMessage()… that message is received by another app which in turn sends another message back.
After some more testing it appears that my problem is that the easyTCPSocket.SendMessage() does not actually send the message until the .showModal window is dismissed. If I simply .show the window instead of .showModal the message is sent and the reply is received OK.
Is this expected behavior? Should .showModal block the socket from sending?[/quote]
If the socket on the modal window ? If it is, it should work.