Article View: aus.computers.java
Article #458Java equivalent of C struct.
From: Doug Rickard
Date: Fri, 20 Oct 2000 00:00
Date: Fri, 20 Oct 2000 00:00
12 lines
1497 bytes
1497 bytes
I have a lot of C network programs I am trying to convert across to Java. I have a simple Java client/server working using socket. However in my existing programs I use complex C structs to define all the different data types in the packet. How can I do the equivalent in Java? The packet is a mix of bytes, ints, floating point, strings, etc. I have tried a couple of suggestions previously given in this newsgroup, but I found that each variable was being sent as a separate TCP packet, and the network overheads were horrific. I need a way of building up large packets that I can send as one transmission. I need to be able to build in a Java client a packet that will be understood by my existing C server. Doug.
Technical Details
Message-ID:
<39efb67d@news.iprimus.com.au>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d6db,597d7cc1e802e828,start X-Google-Attributes: gid10d6db,public From: "Doug Rickard" <rickard@primus.com.au> Subject: Java equivalent of C struct. Date: 2000/10/20 Message-ID: <39efb67d@news.iprimus.com.au> X-Deja-AN: 683650066 X-Original-NNTP-Posting-Host: 203.134.109.38 X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Trace: news0.optus.net.au 972011166 203.134.64.67 (Fri, 20 Oct 2000 14:06:06 EST) Organization: CWO Customer - reports relating to abuse should be sent to abuse@optus.net.au X-Original-Trace: 20 Oct 2000 14:05:33 +1100, 203.134.109.38 X-MSMail-Priority: Normal NNTP-Posting-Date: Fri, 20 Oct 2000 14:06:06 EST Newsgroups: aus.computers.java