-
Extracting data from a datagrampacket
Hi
I have setup a server from which accepts request from a client about certain information. The client has to compose a request to the server with a username and account number that has to fit into a certain request format. I have managed to do this by defining the username and account number as string, defining their values, padding the empty space to fit the request format that the server accepts (username = 30 bytes account number = 10 bytes) and then send the request in a DatagramPacket.
The problem I have is the server sends back a range of different information in a DatagramPacket. For example the first 4 bytes of information are the reference numbers (for example 28, 45, 31, 124) then the next 30 bytes is the Username and so on.
How can I extract the appropriate numbers of bytes for each value (reference number, username …).
Can I read it all into one string then just split it up?
Many Thanks
Sam
Similar Threads
-
By Kathleen Dollard in forum .NET
Replies: 14
Last Post: 05-03-2002, 12:10 AM
-
By Peter Prager (Canam Software) in forum vb.announcements
Replies: 0
Last Post: 08-15-2001, 10:48 AM
-
By Tim Frost in forum xml.announcements
Replies: 0
Last Post: 04-02-2001, 10:53 AM
-
By Sudip Sarbajna in forum XML
Replies: 0
Last Post: 12-10-2000, 08:28 PM
-
By sb in forum VB Classic
Replies: 0
Last Post: 07-22-2000, 04:07 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks