473,395 Members | 1,341 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.

socket hangs

Hi,

I am programming asynchronous communication between client and server,
with .net asynchronous sockets example from MSDN
(http://msdn.microsoft.com/library/de...rversocket.asp)

The problem is that the application hangs on the client side, when the
server sends a buffer. It doesn't reach the read-callback (that is
assigned right after successful "Connect(server,port)") on the client
side, the app just hangs.

So: is a .net socket full-duplex, i.e. can it send and receive ?
When I the sockets are asynchronous, should the Blocking property be
set to false (since the documentation says it's true by default) ?

How can I debug the hanged app/machine to know what's really goes on,
and why the client is stuck ?

Any help would be appretiated!
Alex.
Jul 21 '05 #1
3 2317
al***@mailinator.com (Alex) wrote in
news:27**************************@posting.google.c om:
The problem is that the application hangs on the client side, when the
server sends a buffer. It doesn't reach the read-callback (that is
assigned right after successful "Connect(server,port)") on the client
side, the app just hangs.
Are you committed to async? Why not use synchronous?
So: is a .net socket full-duplex, i.e. can it send and receive ?
When I the sockets are asynchronous, should the Blocking property be
set to false (since the documentation says it's true by default) ?


It would seem so, because blocking = synchronous.

--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
ELKNews - Get your free copy at http://www.atozedsoftware.com

Jul 21 '05 #2
"Chad Z. Hower aka Kudzu" <cp**@hower.org> wrote in message news:<Xn******************@127.0.0.1>...
al***@mailinator.com (Alex) wrote in
news:27**************************@posting.google.c om:
The problem is that the application hangs on the client side, when the
server sends a buffer. It doesn't reach the read-callback (that is
assigned right after successful "Connect(server,port)") on the client
side, the app just hangs.


Are you committed to async? Why not use synchronous?


I don't want to manage a thread for each client, and,
generally, at least in MFC programming synchronous socket is an awful
idea.
There are really no synchronous sockets, and system.net socket uses
completion ports, which should make them fast enough for my needs. So,
I'll stick to asynchronous.
So: is a .net socket full-duplex, i.e. can it send and receive ?
When I the sockets are asynchronous, should the Blocking property be
set to false (since the documentation says it's true by default) ?


It would seem so, because blocking = synchronous.

Of course, but what is the difference in behaviour of asynchronous
socket with callbacks when blocking is set to true, versus false ? Do
you know ?
Jul 21 '05 #3
al***@mailinator.com (Alex) wrote in
news:27**************************@posting.google.c om:
I don't want to manage a thread for each client, and,
It depends on what you are doing, but in most cases it makes things much
easier.
generally, at least in MFC programming synchronous socket is an awful
idea.
That is not true - this is very common misconception conceived early on in
the Windows 3.1 days.
There are really no synchronous sockets, and system.net socket uses
completion ports, which should make them fast enough for my needs. So,
I'll stick to asynchronous.
There are two types of async - the message based ones and the IOCP ones.
Direct IOCP writing creates spaghetthi bug prone code.

Except under the heaviest of loads you wont notice a difference, and a single
thread queing all responses will actually respond slower because it forms a
bottlenceck.
Of course, but what is the difference in behaviour of asynchronous
socket with callbacks when blocking is set to true, versus false ? Do
you know ?


Not in this case. MS doesnt give source to this stuff, which is a real shame.


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
ELKNews - Get your free copy at http://www.atozedsoftware.com

Jul 21 '05 #4

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

Similar topics

11
by: anuradha.k.r | last post by:
hi, i am writing a socket program in python,both client side and server side.I've written the client side which is working perfectly fine(checked it against server program written in C).but as for...
4
by: Jane Austine | last post by:
Running Python 2.3 on Win XP It seems like socket is working interdependently with subprocesses of the process which created socket. ------------------------------------ #the server side >>>...
0
by: Tejaswi | last post by:
Hello! I have a J# socket client that does an HTTP Post. Code pasted below. This client works fine on my XP and Win 2003 boxes, but on my Win 2000 Server box, the socket just hangs when it tries...
10
by: feel52 | last post by:
Below you'll find the code i'm working on. It's in a button click routine and hangs after 3 or 4 sometimes 5 loops done, probably in sock.receive(....). Some code was found here( on google i mean)...
3
by: Alex | last post by:
Hi, I am programming asynchronous communication between client and server, with .net asynchronous sockets example from MSDN...
1
by: opi | last post by:
My blocking TCP server hangs in the Accept method when the client software sometimes gets an error. Are there any ways to stop this blocking in the Accept method so I dont have to restart the...
0
by: Blog the Haggis | last post by:
Hi all, I've written a program which distributes binary data to a number of clients via TCP. The program runs perfectly unless one of the client programs hangs and then it freezes while waiting...
10
by: Hendrik van Rooyen | last post by:
While doing a netstring implementation I noticed that if you build a record up using socket's recv(1), then when you close the remote end down, the recv(1) hangs, despite having a short time out...
2
by: Nicolas Le Gland | last post by:
Hello everyone here. This is my first post in this newsgroup, I hope I won't be to much off-topic. Feel free to redirect me to any better group. I am getting strange timing issues when...
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...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.