473,395 Members | 1,537 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Packets not sending properly

When i sent a packet with size less than 15 it will sent.But when i sent a packet greater than that it won't sent.Sometimes, it will sent greater than 15.Sometimes won't.What is the reason for that? Plz give me some solutions...
Jul 16 '08 #1
7 1738
Nepomuk
3,112 Expert 2GB
When i sent a packet with size less than 15 it will sent.But when i sent a packet greater than that it won't sent.Sometimes, it will sent greater than 15.Sometimes won't.What is the reason for that? Plz give me some solutions...
How are you trying to send these packages? The problem could be one of many, and without further information, we'd be looking for the famous needle in a haystack.

Greetings,
Nepomuk
Jul 16 '08 #2
Hi,
Packet size less than 15 means, i am not getting. Is it 15 bytes.
If it is 15 bytes, i don't understand why it is not working for you. Is it program you wrote or some other application?
Regards,
Arul
Jul 16 '08 #3
Hi,
Packet size less than 15 means, i am not getting. Is it 15 bytes.
If it is 15 bytes, i don't understand why it is not working for you. Is it program you wrote or some other application?
Regards,
Arul

Expand|Select|Wrap|Line Numbers
  1. short Sender::SendDataSync(Byte SendBuffer[])
  2.     {
  3.     try
  4.     {
  5.     this->writer->Write(SendBuffer);
  6. String *str=Sender::BytesToUnicodeStringWC(SendBuffer,SendBuffer->Count);    Sender::LogData(String::Concat("Sent : ",str), S"log");
  7.     SendBuffer=0;
  8.               }//try
  9. }
  10.  
in SendBuffer, i have the data to send.If i have more tha 16 bytes of data, SendBuffer has that much of data.
But this->writer->Write(SendBuffer) will send only 16 bytes of data.here writer specifies BinaryWriter.When I check with network monitor, the data send will be 16 bytes.. What is the reason for that?
Jul 16 '08 #4
arnaudk
424 256MB
Exactly which networking library are you using?
Jul 16 '08 #5
Sir,
I am using System::Net::Sockets.
Expand|Select|Wrap|Line Numbers
  1. BinaryWriter *writer;
  2. TcpClient *client;
  3. NetworkStream *clientStream;
  4.  
  5. Sender *sockWriter;
  6. Sender *localSocketWriter;
  7.  
  8. Sender::Sender(NetworkStream *clientStream)
  9.     {
  10.         this->clientStream =clientStream;
  11.         this->writer=new BinaryWriter(this->clientStream);
  12.     }
  13.  
  14. sockWriter=new Sender();
  15. sockWriter->client =new TcpClient();
  16. sockWriter->client->Connect(this->hostName,this->port_number);   
  17. sockWriter->clientStream=sockWriter->client->GetStream();
  18. localSocketWriter=new Sender(this->sockWriter->clientStream);
  19.  
Establishing TCP communication using TCPClient().Connection established successfully.When i sent authentication packet, the device accept authentication request and replies back.When I want to send a packet with 28 bytes(header 4 bytes,payload 24 bytes),it will send only 16 bytes(header 4 bytes and payload 12 bytes).I dont know where the remaining dats resides.But after sending the data, when i check the buffer(SendBuffer) it contains all the data.Why?What is actually happend in that?..
Jul 17 '08 #6
arnaudk
424 256MB
I am using System::Net::Sockets.
I think you'll have more luck on the .NET forum then.
Jul 17 '08 #7
hi......

I solved this problem. The problem is, the window size. When the destination ackowledges my packet, it sends its window size as 16. That's why, 16 bytes are taken by the destination.Now i corrected it, and it works fine.


Thanks for your valuable replies.
Jul 19 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Terence | last post by:
I'm writing an XML application at the moment and I'm trying to implement exception handling - particularly fatal exceptions. currently if a fatal exception is raised, I create error data in XML...
1
by: yawnmoth | last post by:
so... i'm trying to send some FTP packets, via PHP, and... i'm not really sure how to construct 'em. HTTP 1.0 packets have the following structure: GET http://whatever.com/ HTTP/1.0 Accept:...
0
by: Andreas Pauley | last post by:
Hi, I'd like to generate my own icmp packets from within python. Typically this would include sending an ECHO_REQUEST and checking if I get an ECHO_REPLY back. But I would also like to...
4
by: Brian Rice | last post by:
I have a socket application that is sending and receiving packets asynchronously. It works great except, when I receive packets that are larger than my receive buffer which then generate several...
5
by: Glenn Wilson | last post by:
I am writing a network system for project I am working on. How would I send a class or structure to the clients and recieve one back. Or how would I go about building a packet with a header and...
3
by: Hiroyuki Tanaka | last post by:
Dear Readers, I am trying to learn C# network programming and I have discovered that Windows TCPIP often joins small packets and send them as one to the remote server. This appears to be a...
6
by: Ryan | last post by:
Hi, I am confused with how NetworkStream works. My application needs to handle heavy requests sent through TCP socket connection. I use NetworkStream.Read method to get the stream...
6
by: White Spirit | last post by:
I can send data over a raw socket in C#. The part that is currently a problem is constructing the packet to be sent. To construct the packet, is it necessary to construct the packet 'by hand' and...
5
by: jaco.versfeld | last post by:
Hi There, I have a basic TCP client and TCP server in C++. The TCP client connects to the server, and after a setup phase starts to transmit a file to the TCP server using multiple packets...
2
by: =?Utf-8?B?R3JlZ0lJ?= | last post by:
Hi All, I have some problems with sending UDP packets using Winsock. I tried to send some to a closed port, and according to the documentation on Microsoft MSDN site...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.