actually it works well until last night...
this morning I found client will disconnect to server as soon as connected.
I use GCDAsyncSocket public class, the "didConnectToHost" already be called by system, that means it already connected with server. but immerdiately the client will disconnct this connection. After tracing, I found the function "CFReadStreamCallback" and "CFWriteStreamCallback" is called as soon as the connection built, but the type is "kCFStreamEventErrorOccurred", and the error information is "The operation couldn’t be completed. Socket is not connected".
I deleted all the write and read operation on client, and the write operation on server from my own code. to make sure there is not service message between client and server. but the result is same, the client disconnect the connection as soon as it connected.
And if I ignore the "kCFStreamEventErrorOccurred" message, and shield the disconnect operation on function "CFReadStreamCallback" and "CFWriteStreamCallback", everything work well. the message between client and server can communicated normal.
So, who can kindly tell me why? what make the message "kCFStreamEventErrorOccurred" occured?
thanks!