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

Home Posts Topics Members FAQ

wrong # bytes on socket... for some reason always 8,000 bytes.

one thing to keep in mind is that i've written multiple
tcp apps in .net 2002 and 2003, and haven't seen this
problem before. I have a simple socket app where a
client sends some # of bytes to the server, where the
server responds back with the same # bytes. i set this
value to 441 bytes (so that it is an odd number). the
server receives 8,000 bytes. always. no matter what.
every single time. i send 441 bytes 1 time and the
server receives 8,000 bytes. the bytes are repeated
almost 20 times. i check the data and it matches what i
sent, except it's repeated over and over. i'm posative
i'm sending it only once. i wrote a routine to record
the # of sends and the # received and it looks like this
(based on a timer). send/receive:

1/8
2/16
3/24
4/32

i've changed the # of bytes i send to 1,000, 500, 441,
etc and it ALWAYS shows up as 8,000 bytes. what the heck
is going on!?!?!?! this is driving me nuts.

also, i'm working on a single box using ip 127.0.0.1.

thanks.

Nov 20 '05 #1
1 1431
On 2003-10-29, <an*******@disc ussions.microso ft.com> <an*******@disc ussions.microso ft.com> wrote:
one thing to keep in mind is that i've written multiple
tcp apps in .net 2002 and 2003, and haven't seen this
problem before. I have a simple socket app where a
client sends some # of bytes to the server, where the
server responds back with the same # bytes. i set this
value to 441 bytes (so that it is an odd number). the
server receives 8,000 bytes. always. no matter what.
every single time. i send 441 bytes 1 time and the
server receives 8,000 bytes. the bytes are repeated
almost 20 times. i check the data and it matches what i
sent, except it's repeated over and over. i'm posative
i'm sending it only once. i wrote a routine to record
the # of sends and the # received and it looks like this
(based on a timer). send/receive:

1/8
2/16
3/24
4/32

i've changed the # of bytes i send to 1,000, 500, 441,
etc and it ALWAYS shows up as 8,000 bytes. what the heck
is going on!?!?!?! this is driving me nuts.

also, i'm working on a single box using ip 127.0.0.1.

thanks.


Can you create a simple demo that recreates your problem? I've never
experienced or seen anything like what your describing...

--
Tom Shelton
MVP [Visual Basic]
Nov 20 '05 #2

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

Similar topics

15
6732
by: Phillip Rhodes | last post by:
Hi all, I have a question I hope someone can help me with: I'm doing some communication over a socket, and have need to send and receive values of type double. I'm doing everything in terms of single byte reads and writes to the socket, so what I need to do is take the individual bytes I receive, that represent a double, and actually turn them into a double. This I'm struggling to figure out. I can easily combine the bytes into a...
5
4224
by: Russell Warren | last post by:
Does anyone know the scope of the socket.setdefaulttimeout call? Is it a cross-process/system setting or does it stay local in the application in which it is called? I've been testing this and it seems to stay in the application scope, but the paranoid side of me thinks I may be missing something... any confirmation would be helpful.
11
2032
by: Alfonso Morra | last post by:
Hi, I am at the end of my tether now - after spending several days trying to figure how to do this. I have finally written a simple "proof of concept" program to test serializing a structure containing pointers into a "flattened" bit stream. Here is my code (it dosen't work). I would be grateful for any feedback that helps fix this. My intention
4
2275
by: chellappa | last post by:
Hi, This is program for socket program for server and client ... but data send from client and receive by server but i can t sen d message fro m server to client ... check i mistake .. i treed .. its have some mistake.. if possible correct and send me server.c ========== #include <sys/types.h> #include <sys/socket.h>
13
2423
by: Shailesh Humbad | last post by:
Here is an advanced PHP question. Can anyone think of a way to detect the number of bytes written to output when a script is aborted? I am sending a large file to the client, and I want to record how many bytes are actually sent. I can detect abort of the script using a shutdown handler. In the shutdown handler, I tried ob_get_length, but it returns false. I tried to read the server's log file, but it is does not contain the...
2
7563
by: Ben | last post by:
I need to send data from a client to a server. In the server code I have: s = ServerSocket.Accept() If (s.Connected = False) Then MsgBox("Unable to connect", , "Server Error") Exit Sub End If While (s.Connected = True)
5
2630
by: Jens | last post by:
Hello, I have been looking for some C-code which listens on a user-defined port for incoming data traffic. When data is received, the data is written to a file. I found some C-code (server) that almost does the job. It listens on a user-defined port and responds to incoming data by writing how many times somebody has tried to connect to the server.
10
5168
by: ThunderMusic | last post by:
Hi, I'm currently working with sockets. I accept connections using m_mySocket.Listen(BackLogCount); But when I want to stop listening, I shutdown all my clients and call m_mySocket.Close(), but it always raise a OnConnect event (actually, it calls the callback function as if there was a new connection attempt) and I receive a ObjectDisposedException as soon as I do m_mySocket.EndAccept. Does anyone have any idea of what I could do about...
10
2490
by: Guillermo_Lopez | last post by:
Hello All, I am using VBA in access to perform some calculations. There is a particular sumation that is wrong (barely). this code is withing a loop. TDist = TDist + TempDist Both TDist and TempDist are declared as doubles:
0
8472
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
8390
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8909
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
8819
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
8667
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...
1
6222
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
5690
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
4399
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2048
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.