I've already read about 40 pages threading, but still I'm not sure about my case. An NSObject, which opens a socket connection on a device. This object handles all communications, sending and receiving messages and so on. I would like that this stuff works on different threads. I tried to do something like this:
- Connect: (ID) sender {SocketConnectionController * sock = [SocketConnectionController new]; [[SOCK IN WITH WITH PARAMES: IP.Text: Port.Text Etc.) Selector background: @sillector (Initvith Parama: :) with object: Nile]; Send [[SOCKETNECONNECTION CONTROLLER INSTANCE] COMMOD: GEEEIDIDIT]; }
As you see, I am sending some messages using the current example of socket condensation controller, but it does not send anything, maybe my There is some leak to understand the side, that the connection is open due to flashing light on the device. Am I making thread on the right track? If so, how can I use it?
Update 1: I tried to do something like this: NSOperationQueue * queue = [NSOperationQueue new]; Socket connection * sock = [socket connection new]; [Add quote operation: sock]; But on the CPU graph, I see that the stuff is still running on thread 1 (mainstay). What am I doing wrong?
Update 2 I came to know that the run loop, which I still need to run on main thread for input and output stream.
Comments
Post a Comment