Packets not sending properly

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • selvialagar
    New Member
    • Apr 2008
    • 57

    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...
  • Nepomuk
    Recognized Expert Specialist
    • Aug 2007
    • 3111

    #2
    Originally posted by selvialagar
    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

    Comment

    • Arulmurugan
      New Member
      • Jan 2008
      • 90

      #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

      Comment

      • selvialagar
        New Member
        • Apr 2008
        • 57

        #4
        Originally posted by Arulmurugan
        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

        Code:
        short Sender::SendDataSync(Byte SendBuffer[])
        	{
        	try
        	{
        	this->writer->Write(SendBuffer);
        String *str=Sender::BytesToUnicodeStringWC(SendBuffer,SendBuffer->Count);	Sender::LogData(String::Concat("Sent : ",str), S"log");
        	SendBuffer=0;
                      }//try
        }
        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(SendBuff er) will send only 16 bytes of data.here writer specifies BinaryWriter.Wh en I check with network monitor, the data send will be 16 bytes.. What is the reason for that?

        Comment

        • arnaudk
          Contributor
          • Sep 2007
          • 425

          #5
          Exactly which networking library are you using?

          Comment

          • selvialagar
            New Member
            • Apr 2008
            • 57

            #6
            Sir,
            I am using System::Net::So ckets.
            Code:
            BinaryWriter *writer;
            TcpClient *client;
            NetworkStream *clientStream;
            
            Sender *sockWriter;
            Sender *localSocketWriter;
            
            Sender::Sender(NetworkStream *clientStream)
            	{
            		this->clientStream =clientStream;
            		this->writer=new BinaryWriter(this->clientStream);
            	}
            
            sockWriter=new Sender();
            sockWriter->client =new TcpClient();
            sockWriter->client->Connect(this->hostName,this->port_number);   
            sockWriter->clientStream=sockWriter->client->GetStream();
            localSocketWriter=new Sender(this->sockWriter->clientStream);
            Establishing TCP communication using TCPClient().Con nection established successfully.Wh en 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(SendBuff er) it contains all the data.Why?What is actually happend in that?..

            Comment

            • arnaudk
              Contributor
              • Sep 2007
              • 425

              #7
              Originally posted by selvialagar
              I am using System::Net::So ckets.
              I think you'll have more luck on the .NET forum then.

              Comment

              • selvialagar
                New Member
                • Apr 2008
                • 57

                #8
                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.

                Comment

                Working...