I am getting pretty frustrated, i have an tcp server running on my mac where i have a couple of devices hooked up to. I wanted to have my iphone connected to it so i can run som commands from my iphone directly to my mac @ home.
The tcp client for my iphone works pretty good except for one fault, it seems like it doesnt clear up the outputstream for each string i send. Here is an example of what i am having problems with
Does anyone have any sugestions? I would appreciate all help, if you need to see any of my code please post an message saying so and i will have it posted.
Without any code I can only guess, but this looks like a bug in your code that handles the string input. In case you are using a NSMutableString / NSMutableData to store your input, make sure you clear that input after accepting a command. It now looks like you just overwrite the beginning without actually erasing it first.
The source of the problem was that my server software not emptying the datastream. When I emptied the stream on the server side, it worked perfectly.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.