Question

I am using cocoaasyncsocket as socket receiver on my mac and send the data in the socket from a PHP file.

How can I add a tag in the PHP socket so that I can retrieve the tag with the didReadData method?

Was it helpful?

Solution

According to a bit of Google, a "socket tag" is a mechanism in the AsyncSocket library that allows you to keep track of socket connections.

According to the documentation:

Tag values are not transmitted to the remote socket, and the remote socket does not transmit tag values to the local socket. But the message sent by the local socket to its delegate upon completing the operation includes the tag value you initially supplied.

Thus, to answer your question: PHP can't set any sort of tag on the socket, because tags are local to the library being used by your application. If you're losing the tag on the socket, it's because you might not be using the library correctly. Without seeing any code, it's going to be difficult to impossible to say for sure.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top