473,385 Members | 1,838 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,385 software developers and data experts.

Socket call back that received packet data gets 0 byte packets

During a TCP connection, using standard Sockets, when the other end
decides to cancel the connect, before the socket is disconnected, the
call back to receive the incoming data gets called 100's and 1000's of
times with 0 bytes. And finally the socket disconnects.

I am not sure what this means. Why is it called at all, just to give
me 0 bytes? Of course, I can just ignore these 'no data' packets,
but, I'd like to know why they exist.

any help is appreciated.

Zytan

Apr 24 '07 #1
2 2274
.....the call back to receive the incoming data......

This is what is passed to Socket.BeginReceive(), to be called when any
data arrives.

Zytan

Apr 24 '07 #2
I am not sure what this means. Why is it called at all, just to give
me 0 bytes?
Ah, this thread:
http://forums.microsoft.com/MSDN/Sho...77132&SiteID=1
says:

"On the receiving end while a application is in call to
NetworkStream.Read or Socket.Receive method or their equivalent
Asynchronous methods, whenever the sending socket is disconnected you
get 0 bytes from Read or Receive methods."

So, I'm sitting here asking for something, waiting for something, and
when it gives me 0 bytes, it must be telling me, "you're not connected
anymore". And stupid me is asking for more data, to which it replies
the same thing.

Zytan

Apr 24 '07 #3

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

Similar topics

3
by: Stephan Steiner | last post by:
Hi I have a small program listening to UDP broadcast datagrams that are periodically sent out. It will stop listening for a certain period if either a sufficient number of packets has been...
3
by: Robert A. van Ginkel | last post by:
In news:OZ0W9RsdDHA.2432@TK2MSFTNGP10.phx.gbl... I ask the question how I can see if all the data is on the other side of the connection. I got as answer that I should use the blocking property. I...
10
by: Jim H | last post by:
I have a UDP socket that sends out a request on a multicast socket and waits for a response. This client is not listening on a multicast IP but the local IP. The server (UNIX) responds to the...
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: John Sheppard | last post by:
Hi all, I am not sure that I am posting this in the right group but here it goes anyway. I am new to socket programming and I have been searching on the internet to the questions I am about to pose...
9
by: Macca | last post by:
Hi, I have a synchronous socket server which my app uses to read data from clients. To test this I have a simulated client that sends 100 byte packets. I have set up the socket server so...
0
by: Macca | last post by:
Hi, I am writing an asychronous socket server to handle 20+ simulataneous connections. I have used the example in MSDN as a base. The code is shown at end of question. Each connection has a...
0
by: george585 | last post by:
Hello! I am new to network programming, and understand just basics. Using some sample code, and having read documentation, I managed to create a simple app in C# and VB.NET. The application is...
4
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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,...
0
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...

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.