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

select and send

Hi,

For socket, I know how to use select and recv, but I don't know how to
use select and send?
Is anybody know?

Thanks,

Wenfei

Jul 27 '05 #1
11 6246

"Wenfei" <ye*******@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Hi,

For socket, I know how to use select and recv, but I don't know how to
use select and send?
Is anybody know?

Thanks,

Wenfei


You need to ask in a newsgroup for your operating system, or for the
compiler or library you're using that provides these functions. They're not
standard C++ functions.

-Howard
Jul 27 '05 #2
Wenfei wrote:
For socket, I know how to use select and recv, but I don't know how to
use select and send?
Is anybody know?


I can't speak to comp.lang.c (the rules may have changed since I
frequented it), but in comp.lang.c++ it's off-topic. Try the NG
dedicated to your OS -- network programming is OS-specific.

V
Jul 27 '05 #3

"Wenfei" <ye*******@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Hi,

For socket, I know how to use select and recv, but I don't know how to
use select and send?
Is anybody know?

Thanks,

Wenfei


This is off-topic for this group as this is not defined by the C standard

<OT>
On my system, you do not need to use select() if you want to send() on a
socket, one just merely calls send() with the appropriate parameters set.
</OT>

Allan
Jul 27 '05 #4
"Howard" <al*****@hotmail.com> writes:
"Wenfei" <ye*******@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Hi,

For socket, I know how to use select and recv, but I don't know how to
use select and send?
Is anybody know?

Thanks,

Wenfei


You need to ask in a newsgroup for your operating system, or for the
compiler or library you're using that provides these functions. They're not
standard C++ functions.


Nor are the standard C functions. Cross-posting to comp.lang.c and
comp.lang.c++ is rarely a good idea.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jul 27 '05 #5
[]
<OT>
On my system, you do not need to use select() if you want to send() on a
socket, one just merely calls send() with the appropriate parameters set.
</OT>


<OT>
And how on your system do you wait for a ready for write event after a
nonblocking send returns you -1 and errno == EAGAIN?
</OT>

Jul 28 '05 #6

"Maxim Yegorushkin" <ma***************@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
[]
<OT>
On my system, you do not need to use select() if you want to send() on a
socket, one just merely calls send() with the appropriate parameters set.
</OT>


<OT>
And how on your system do you wait for a ready for write event after a
nonblocking send returns you -1 and errno == EAGAIN?
</OT>


I dont think we should be discussing this but
<OT>
who said I used nonblocking sockets?
</OT>

Allan
Jul 28 '05 #7
I mean, When use select() and send() to handle multi connections,
should we use listen and accept also, like select and recv?
Which of the follwoing is correct?

1)
....
FD_SET(sockfd, &fdwrite);
listen(sockfd, NET_TCP_MAX_SYN_BACKLOG);
select(...);
connectionfd = accept(sockfd, ...);
FD_SET(connectionFD, &fdwrite);
if (FD_ISSET(connectionfd, &fdwrite))
send;

OR, 2)

FD_SET(sockfd, &fdwrite);
listen(sockfd, NET_TCP_MAX_SYN_BACKLOG);
select(...);
connectionfd = accept(sockfd, ...);
// run through the existing connections to send
for( i = 0; i <= maxFD; i++ )
if ( (FD_ISSET(connectionfd, &fdwrite)) && (i != sockfd) )
send;

OR , 3)
....
FD_SET(sockfd, &fdwrite);
listen(sockfd, NET_TCP_MAX_SYN_BACKLOG);
select(...);
if (FD_ISSET(sockfd, &fdwrite))
send;

OR , 4)
....
FD_SET(sockfd, &fdwrite);
select(...);
if (FD_ISSET(sockfd, &fdwrite))
send;
Thanks,

Wenfei

Jul 28 '05 #8

"Wenfei" <ye*******@hotmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I mean, When use select() and send() to handle multi connections,
should we use listen and accept also, like select and recv?
Which of the follwoing is correct?


Please take such questions to a newsgroup where such things are topical.
This newsgroup is for discussing C++ _language_ issues, not OS-specific
issues using C++ programs.

-Howard
Jul 28 '05 #9

"Wenfei" <ye*******@hotmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I mean, When use select() and send() to handle multi connections,
should we use listen and accept also, like select and recv?
Which of the follwoing is correct?

1)
...
FD_SET(sockfd, &fdwrite);
listen(sockfd, NET_TCP_MAX_SYN_BACKLOG);
select(...);
connectionfd = accept(sockfd, ...);
FD_SET(connectionFD, &fdwrite);
if (FD_ISSET(connectionfd, &fdwrite))
send;

OR, 2)

FD_SET(sockfd, &fdwrite);
listen(sockfd, NET_TCP_MAX_SYN_BACKLOG);
select(...);
connectionfd = accept(sockfd, ...);
// run through the existing connections to send
for( i = 0; i <= maxFD; i++ )
if ( (FD_ISSET(connectionfd, &fdwrite)) && (i != sockfd) )
send;

OR , 3)
...
FD_SET(sockfd, &fdwrite);
listen(sockfd, NET_TCP_MAX_SYN_BACKLOG);
select(...);
if (FD_ISSET(sockfd, &fdwrite))
send;

OR , 4)
...
FD_SET(sockfd, &fdwrite);
select(...);
if (FD_ISSET(sockfd, &fdwrite))
send;
Thanks,

Wenfei


This is the whole point of not discussing Off-topic here. My operating
sytem and setup does not require me to use select() for sending at all.

Allan
Jul 28 '05 #10
Wenfei wrote:
I mean, When use select() and send() to handle multi connections,
should we use listen and accept also, like select and recv?
Which of the follwoing is correct?


What part of "this is off-topic" are you having a problem with?


Brian
Jul 28 '05 #11
Wenfei wrote:

I mean, When use select() and send() to handle multi connections,
should we use listen and accept also, like select and recv?
Which of the follwoing is correct?


You have already been told that this is Off-Topic for c.l.c (and
probably c.l.c++ also), and that you should find a newsgroup
dealing with your system. So why are you rudely annoying us by
continuing the thread? Do you go to a motorcycle dealer when you
want a truck?

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
Jul 28 '05 #12

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

Similar topics

4
by: D. Shifflett | last post by:
Hi all, I am trying to run a Python program on my Win XP box, that I brought over from a Linux box. Of course, on Linux it works fine, but not so on Win XP. The program has a button to cause a...
1
by: D. Shifflett | last post by:
Hi all, I am having trouble with a program that ran fine on Python 2.0 (#0, Mar 1 2001, 01:47:55) on linux2 but will not work on Python 2.3.2 (#1, Oct 8 2003, 17:33:47) on linux2
0
by: Ktm | last post by:
Hi, the following code (just taken on the example) blocks on recv unless I uncomment the 'send' function. I tested it with stunnel. Select seems to tell that there is something to read whereas...
1
by: Ktm | last post by:
Hello, I don't have the same behaviour with two codes who are quite the same, one using SSL, the other not. I tested the programs with stunnel and telnet , respectively. Here are the first...
4
by: bobsawyer | last post by:
I've been building a series of SELECT lists that are populated dynamically using HTTPRequest. Things are going pretty well, and I've got the whole thing working flawlessly in Mozilla/Firebird....
3
by: Marcia Hon | last post by:
Hi, I am trying to use the select() socket programming command to select between stdin and a connection. Currently, I have a listening stream and stdin that I insert into the fd_set. The problem...
9
by: Wenfei | last post by:
Hi, For socket, I know how to use select and recv, but I don't know how to use select and send? Is anybody know? Thanks, Wenfei
21
by: Leena P | last post by:
i want to basically take some information for the product and let the user enter the the material required to make this product 1.first page test.php which takes product code and displays...
25
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if my question needs to be here or in coldfusion. If i have my question is in the wrong section i am sorry in advance an will move it to the correct section. ...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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.