473,473 Members | 3,363 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

RE: {simple} sockets socket.Receive question

Dear Sir/Mam,

I have written a server code using the Windows Socket API's. Wherein I have
created the socket and bound it to a particular IP address and port number.
Later I have made the socket in non-blocking mode by using the proper socket
option ( i.e. SO_RCVTIMEO). After which with the use of recv() I am trying to
get into the receive mode. Here as the receive time out is being used the
socket should come out of the block mode after the time out value. But this
is not happening here, instead the socket is always in the blocking mode.

I am facing this kind of an issue only on few of the VISTA systems. Whereas
on few other VISTA systems it is working fine (means we are ableto switch
between block and non-block modes).
But there is no problem on any of the XP systems.

Could you please provide me with information related to this and help in
deriving a proper conclusion.

Thanks in advance,
Rajni

"War Eagle" wrote:
clientSocket.Receive(PreRxBuffer, 0,4, 0);

Does this function block? What happens if the client only sends 3 bytes? What if the client sends 5 bytes or 5000 bytes?
Sep 18 '08 #1
1 1810
On Wed, 17 Sep 2008 21:56:00 -0700, Rajni
<Ra***@discussions.microsoft.comwrote:
I have written a server code using the Windows Socket API's. Wherein I
have
created the socket and bound it to a particular IP address and port
number.
Later I have made the socket in non-blocking mode by using the proper
socket
option ( i.e. SO_RCVTIMEO). [...]
1. You only need to post the question once.

2. Your question appears to have nothing to do with .NET or C#. Rather
than hijacking a previous thread in this newsgroup that _was_ related to
..NET, you may prefer to post your question in one of the Winsock
newsgroups (i.e alt.winsock.programming or
comp.os.ms-windows.programmer.tools.winsock).

3. The SO_RCVTIMEO socket option controls the timeout for receives, not
the blocking state of the socket. If you want to set the socket to
non-blocking, use ioctlsocket() or WSAIoctl() with the FIONBIO option.

Pete
Sep 18 '08 #2

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

Similar topics

14
by: jack | last post by:
At this link I have two c# projects, one is a client, the other is a server. Just point the ip address of the client at the server http://www.slip-angle.com/hosted/bug/ The server does...
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...
0
by: user | last post by:
Hello I have socket: System.Net.Sockets.Socket oSocket = new Socket(IPAddress.Any.AddressFamily,SocketType.Stream,ProtocolType.Tcp); IPEndPoint endPoint = new...
1
by: jm | last post by:
Easy probably, please read on. I know some of you have commented already about some of my socket question. I appreciate that. I have a Form1: static void Main() { Application.Run(new...
0
by: Daniel Sélen Secches | last post by:
I found a good class to do a simple FTP. Very good.... I'm posting it with the message, i hope it helps someone ============================================================== Imports...
1
by: verge | last post by:
hello everyone! how's it going? like everyone in here im in need of some help and good friendship along the way...take a look at this: //MODIFIED SO IT DEALS WITH WINDOWS FTP USING ACTIVE...
0
by: J008 | last post by:
Just looking for some insight as to why the callback "BeginReceiveFromCallback" is not being called in my "Receive" Subroutine below (when I call BeginReceiveFrom). I am trying to read data...
0
by: =?Utf-8?B?UmFqbmk=?= | last post by:
Dear Sir/Mam, I have written a server code using the Windows Socket API's. Wherein I have created the socket and bound it to a particular IP address and port number. Later I have made the socket...
0
by: =?Utf-8?B?UmFqbmk=?= | last post by:
Dear William Stacey, I have written a server code using the Windows Socket API's. Wherein I have created the socket and bound it to a particular IP address and port number. Later I have made the...
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
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...
1
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.