I would say that at minimum you should be checking the return value of your call to $client_socket->send(). If it fails, you should get undef, and if it succeeds you'll know how many bytes were written. My bet is that it's failing. If that's the case, try to also inspect what happens when you call $client_socket->new(). That might be informative.
This isn't much different from the types of checks you would do when you open a filehandle. Just as we grow accustomed to checking the success of an 'open' call, we should be checking success of socket interactions.
| [reply] [d/l] |
Have you been drinking again and forgotten your own solution? Or did that not work? How about the solutions offered to you?
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |
Sorry for the late reply had to step away. Thank you both for replying... I will make sure to check the return value going forward as Dave suggested. I was able to figure this issue out. It was not an issue with storable, more of an issue of bad programmer. It was sending the data, problem was I was not receiving it all.my client code was
$client_socket->recv($recieved_data,1024);
I bumped up 1024 to a larger value and that fixed the issue. Thanks again for putting up with me. I appreciate the help.
| [reply] |
I have experienced erratic problems with Storable which prompted me to use YAML instead. (I actually found the format to be much more convenient in the long run, simply because it is human-readable.)
All that I mean by this suggestion is: (a) no, you are not the only person who has had (insurmountable) trouble freezing and thawing things with this module; and (b) consider using another tool to do get the same job done. If the data is large, you can either relax in the knowledge that the socket is really fast, or if the data is really large you can gzip-encode it. My experience was, so to speak, “less filling, tastes great.”
| [reply] |
Apart from your current problem: Are you aware that the Storable data structures keep changing, and that Storable provides only minimal compatibility for different versions of Storable? As soon as client or server are upgraded, you may run into compatibility problems.
You may need to think about a different storage format. JSON, XML, YAML could be alternatives that do not have those kind of compatibility problems, and they even work with different languages.
Alexander
--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
| [reply] |
Thank you for the insight. I will look into YAML for this project. Thanks to all who have provided advice.
| [reply] |