Re: socket communication: socket doesn't connect
- From: "Alexander Nickolov" <agnickolov@xxxxxxxx>
- Date: Mon, 30 Apr 2007 12:02:07 -0700
You can use select on the listening socket and wait for it to become
readable. This is your cue to call accept - you have at least one
client waiting so your accept will succeed. Note select is a blocking
operation - you may want to use it with a timeout in a loop so you
can abort from your server as needed. Finally, this only covers one
client. If your server is to handle multiple clients you'll need to be
handling multiple sockets in your select, or use a differnt thread
for your clients (for up to 63 clients), or multiple threads for handling
clients if they can exceed 63. select and WSASelect are rather similar
models, so you can use this one if you prefer. The main advantage
of WSASelect is you have uniform mechanism for controlling both
socket I/O and thread shutdown.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://vcfaq.mvps.org
=====================================
"Ananya" <Ananya@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BD2D1DBC-2B64-431D-ADC6-AC63EB66EF47@xxxxxxxxxxxxxxxx
Let me just add about the two communications between C++ and Java that I
need
as described above. The first one is done with ShellExecEx, so with
respect
to socket communications, I only need one communication, to bring the
curves
from my Java program back to my C++ program.
.
- References:
- socket communication: socket doesn't connect
- From: Ananya
- Re: socket communication: socket doesn't connect
- From: Michael K. O'Neill
- Re: socket communication: socket doesn't connect
- From: Ananya
- Re: socket communication: socket doesn't connect
- From: Dave Lowther
- Re: socket communication: socket doesn't connect
- From: Ananya
- Re: socket communication: socket doesn't connect
- From: Dave Lowther
- Re: socket communication: socket doesn't connect
- From: Ananya
- socket communication: socket doesn't connect
- Prev by Date: Re: socket communication: socket doesn't connect
- Next by Date: Re: socket communication: send & receive doesn't work right
- Previous by thread: Re: socket communication: socket doesn't connect
- Next by thread: Re: socket communication: socket doesn't connect
- Index(es):
Relevant Pages
|