473,671 Members | 2,570 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to extract size of a packet?

Koo
Look at this example...

SOCKET s;

//you bind and stuff...
//then you recive a paket.

Is there a smart, secure way to get the size of the paket, allocate a
matching buffert and then load the data into it?
Jul 22 '05 #1
1 1637
"Koo" <io********@hot mail.com> wrote...
Look at this example...

SOCKET s;

//you bind and stuff...
//then you recive a paket.

Is there a smart, secure way to get the size of the paket, allocate a
matching buffert and then load the data into it?


I believe that you're in a wrong newsgroup. C++ does not, never
did, and, hopefully, never will, have any support for networking.
There are libraries for that, they are platform-specific. You
need to ask in a newsgroup dedicated to your platform.
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3649
by: pdelacruz | last post by:
Hello, I was wondering is the following is correct with the network packet size. I've installed sql server 2000 and made some changes in the configuration. Now i've read that sql server's default network packet size is 4096 bytes, but when i look up the advanced tab, in the optionsmenu of the enterprise manager, the network packetsize is 0!
12
16899
by: David Sworder | last post by:
Hi, I'm writing an application in which a client (C#/WinForms) and server (C#/service) interact with one another. The client establishes a "session" with the server but for scalability reasons there is not a one to one map between a session and a physical TCP connection. A client may disconnect the TCP connection if it is idle for more than 60 seconds... yet a conceptual "session" may last for days at a time. It's necessary that the...
6
3285
by: SRLoka | last post by:
I am designing a UDP server(still on paper) that will receive data from various client applications(residing on PocketPCs using GPRS) I am using Richard Blum's 'C# Network Programming' as my guide. One thing I wanted clarification on was, when the author says "UDP maintains message boundary", does it mean that the Server will always receive an entire message or not receive it ? What if the Client sends a large message(say 5K) and it gets...
2
4656
by: Macca | last post by:
Hi, My application uses an asynchronous socket server. The question I have is what i should set my socket server buffer size to. I will know the size of each data packet sent across the network and was considering setting the buffer size to this. In the examples I have seen on the net the buffer size is usually set to 1024 bytes and the socket is continually read until all data is received.
2
3840
by: missolsr | last post by:
hi, I am using jpcap to capture OLSR topology control (udp) packets. Does anyone know how to extract data (the way ethereal does it) from the olsr packet? There are methods to extract data from udp and IP packets in jpcap but the issue is that olsr packets have their own header-data and since jpcap can not dig that far, I get nonsense as packet data. 1. Am I right to assume that jpcap can not dig to the data part of the packet...
1
4009
by: davis | last post by:
Hi, I'm writing an app in bluetooth & wi-fi. It is client/server on both. We have defined our own network protocol that should run over both mediums. There are packet definitions of variable length. Inside the packet, one field indicates its length. However, I don't know ahead of time which packet shall be coming in when I read. I'm using asynchronous read methods for both. In sockets, I do Socket.BeginRead( ). This method must...
4
7062
by: Zytan | last post by:
This may be the dumbest question of all time, but... When I set the packet size, does it mean ALL packets are that size, no matter what? Let's say the packet size is 8KB, and I send a 5 byte "hello", will it cause 8KB of bandwidth, or 5 bytes (plus TCP/IP packet header, as well, of course). (Btw, I 'set' the packet size via Socket.BeginReceive(), in the "size" field = "The number of bytes to receive." Which seems to imply the answer...
0
3670
by: neeru29 | last post by:
I'm using Pcapy and impacket module for packet sniffer. I'm able to capture the whole data in a variable and display it. I want extract the IP addresses , Port no's and Payload data into separate variable and display it. code is as follows: import sys import string from threading import Thread
1
4145
by: quddusaliquddus | last post by:
Hi :D, I am sending data to server via TCP IP Connection. I am using a continuous loop at the server end - that accepts new clients and while streams can be read, it reads data stream. The data is sent from the client with 2 leading bytes of data that represent the size of the packet of data sent and type of data. My question is: how do I retrieve the size of the data packet and then check that this amount of data has been...
0
8485
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8930
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8828
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8677
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7446
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6238
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5704
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4417
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2819
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.