Hi
i want to be able to check if information read that came from over a socket
is serilisable, if it isnt i want to handle it differently. Basically i am
trying to make a generic receivedata function that i can send any form of
data over the wire too and it will handle it appropriately.
I know i could do a try catch on a serilisation exception but i dont think
this is a good way to check as other things could cause such an error.
I did think of writing into the first 4 bytes of the send stream an
indenitifier for the response, then the slient can read those bytes and
decide, but again it starts to become less generic. Ideally i would like
anyone to send any info and i can handle it
Any ideas?
Also i am stuck on a scenario where i send data and cant proceed until i get
a response. One of my functions on the client fires a request but if the
client continues before getting a response it will crash. If i get it to
wait i end up poling and everything freezes for a second. I was thinking of
moving my interface logic and my actual application logic to 2 separate
threads. Then i can make the app logic wait while the sent message waits for
a reply, meanwhile the interface thread continues and i get no apparent
freeze. But i am sure this is not good for performance or is this ok?
thanks
i want to be able to check if information read that came from over a socket
is serilisable, if it isnt i want to handle it differently. Basically i am
trying to make a generic receivedata function that i can send any form of
data over the wire too and it will handle it appropriately.
I know i could do a try catch on a serilisation exception but i dont think
this is a good way to check as other things could cause such an error.
I did think of writing into the first 4 bytes of the send stream an
indenitifier for the response, then the slient can read those bytes and
decide, but again it starts to become less generic. Ideally i would like
anyone to send any info and i can handle it
Any ideas?
Also i am stuck on a scenario where i send data and cant proceed until i get
a response. One of my functions on the client fires a request but if the
client continues before getting a response it will crash. If i get it to
wait i end up poling and everything freezes for a second. I was thinking of
moving my interface logic and my actual application logic to 2 separate
threads. Then i can make the app logic wait while the sent message waits for
a reply, meanwhile the interface thread continues and i get no apparent
freeze. But i am sure this is not good for performance or is this ok?
thanks
Comment