I'm working' on socket connections/udp right now.
But i have one question in my mind. How can i send querydataset over
socket?
will i send it like a byte and cast it to the dataset? or what?
You need a means to encode your dataset object as a sequence of bytes,
and another to decode the bytes and reconstitute the dataset on the
other side. Java sports a built-in mechanism to do this, called
serialization. Make your dataset class Serializable (which may be as
simple as just making it implement that interface, but which could be
significantly more complicated), then use ObjectOutputStreams and
ObjectInputStreams to send and receive instances, respectively.
You could also handle the whole thing yourself via some
application-level protocol. Do note, by the way, that UDP is not a
reliable protocol (meaning that it does not guarantee message delivery,
nor delivery order for those messages that are delivered). If that
matters to you then you should probably be using TCP.
John Bollinger
(e-mail address removed)