473,785 Members | 2,720 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multithreaded server : Problem with WSAEventSelect

Hi there :)

I'm trying to code a webserver running under WinXP, multithreaded,
etc...
The creation of my threads, the handles, everything works fine except
this : the WSAEventSelect.

The first occurence of this function is in the main() and manages
connections. If a connection is accepted, it sends the newly created
socket to a thread that will handle both FD_WRITE and FD_READ...
Here's the prob : the second call to the WSAEventSelect fails and
returns WSAENOTSOCK...
I tried to send data thru that socket, and it worked...
What's the deal?
I tried the solution MSDN gave me, with WSAEventSelect( socket, NULL,
0); before setting the thing to FD_READ | FD_WRITE but it still won't
work...

Got an idea ?

Thanks.

Mar 6 '07 #1
2 4323
On Tue, 06 Mar 2007 03:39:30 -0800, NaeiKinDus wrote:
Hi there :)

I'm trying to code a webserver running under WinXP, multithreaded,
etc...
The creation of my threads, the handles, everything works fine except
this : the WSAEventSelect.
[snip]

Afraid both threading and platform-specific details are off-topic here -
this ng deals purely with C++ *language* issues.
Got an idea ?
Perhaps you can find a better forum here:

http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

--
Lionel B
Mar 6 '07 #2
On 6 mar, 14:57, Lionel B <m...@privacy.n etwrote:
On Tue, 06 Mar 2007 03:39:30 -0800, NaeiKinDus wrote:
Hi there :)
I'm trying to code a webserver running under WinXP, multithreaded,
etc...
The creation of my threads, the handles, everything works fine except
this : the WSAEventSelect.

[snip]

Afraid both threading and platform-specific details are off-topic here -
this ng deals purely with C++ *language* issues.
Got an idea ?

Perhaps you can find a better forum here:

http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

--
Lionel B
Sorry for the bother.

Mar 6 '07 #3

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

Similar topics

1
3320
by: Google Mike | last post by:
I want to prepare some training for some new employees regarding the topic of multithreaded socket services implemented in PHP. I've been able to implement this with my own design, but I'd like to hear your thoughts on what you think are some good design goals, such as answering a question like, "Would you open a pack of 5 socket listeners each time you go over a socket threshhold, just to make the server that much more available?" Or...
9
16278
by: John Lull | last post by:
I'm writing a multithreaded COM server to manage a pool of hardware resources. All objects are designed to be thread-safe, and I've set sys.coinit_flags to COINIT_MULTITHREADED before importing pythoncom. The problem is that all requests to the server seem to be serialized by COM. To demonstrate the problem, I'm including a simple test server that exposes one interface object, PyComThreads.Application, with a single method sleep(delay)....
2
6642
by: pradyumna | last post by:
In Project settins - C/C++ - Code Generation, what is the difference between the option "Multithreaded" and "Multithreaded DLL". I understand that on selecting multithreaded option, single and multithreaded applications can both use that dll, but what about multithreaded DLL option. Thanks
1
2344
by: daniel.bron | last post by:
I'm maintaining a C++ application written by a developer who has now left. The app is a multithreaded client/server app for financial data. My compiler is MS visual C++ 6.0. I'm a C++ neophyte. I took some C (not C++) courses in college, this is the only production C++ code I've worked with. I'm trying to add some logging, and having problems. My logging scheme is to have a global ofstream, which I initialize in a
4
5005
by: BBryant | last post by:
Here is the scenario; Two sockets are bound on two seperate UDP ports, 46999 and 47000. Both sockets initilize, and are bound to the ports as expected, however only port 46999 receives data. Any help is greatly appreciated, here is the code;
7
5324
by: Sidd | last post by:
Hi, I tried finding and example of multithreaded client-serve program in python. Can any one please tell me how to write a multithreaded client-server programn in python such that 1.It can handle multiple connections 2.It uses actual threads and not select() or some other function
7
2274
by: Pavils Jurjans | last post by:
Hello, I wanted to get some light in the subject. As I develop ASP.NET applications, it's necessary to understand how exactly the server- communication happens. It seems like initially application is "sleeping", and it is not loaded in the memory. Then, after very first request to the app, it is compiled (aspx files), loaded into memory, and executed. Then, a separate thread is issued to serve my page request, and it takes care for me...
2
1684
by: Alan Kemp | last post by:
Hi, I have a problem that is half python, half design. I have a multithreaded network server working, each client request spawns a new thread which deals with that client for as long as it is connected (think ftp style rather than http style connections here). Each thread gets passed a reference to the main server to access things like the list of connected clients, global data, etc. Now I want to add a database to store usernames...
3
2644
by: akmkat | last post by:
Hi all, I am in a great problem. I am trying to implement a multithreaded server using java, first look at the code... /*------- Main Server (server.java)--------------*/ import java.io.* ; import java.net.* ; public class server {
0
10336
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
9953
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...
0
8978
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7502
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
6741
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
5383
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5513
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3655
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2881
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.