Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Java and C socket programing

  Asked By: Qadriyah    Date: Jul 15    Category: Java    Views: 794
  

I implement a client/server program. The client is
coded in Java, and server is coded in C runing in
Solaris 2.7.

Client tried to send an integer array to server.

int[] buffer = new int[10];
DataOutputStream out = new
DataOutputStream(socket.getOutputStream() );

for( i=0; i<=9; i++)
out.write(buffer[i]);


In server,

int inbuffer[25];
ret = read(sockid, (void *)inbuffer, 100 )

ret should be 10*4 = 40, but it is 10.

How should I sove the problem?

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Java and C socket programing Or get search suggestion and latest updates.




Tagged: