Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Sending the data to the server over a socket!!!

Status
Not open for further replies.

manojch

Programmer
Jun 15, 2000
1
US

Hi,

I am new to Java. Please help me to do the following:

I have a instance of a class say 'mesg'
and I have two members in it which I have assigned
some values. Now I want to send 'mesg' over a socket
to the server, how do I accomplish this. I tried in
java documentation and could find only how to write
short,int,long etc. to the socket but nothing describes
which helps me my case of sending mixed/composite data
over a socket.

Plus do I have to do convert it using something like
htons() before I send it. I am talking to a C server.
If yes, what is the similar call in Java to do that?

I really appreciate your help.

Thanks
-Manoj
 
Dear Manoj,
If you are talking to a C server, you need to have the protocol of the server and then write your mesg to the server according to the protocol.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top