socket problem

  • Thread starter Harbinger of Doom
  • Start date
H

Harbinger of Doom

Hello,

I'm currently working on a project that needs to send data over a network
I use the SOCKET datatype to do that.
Everything works perfectly, but there's just one problem:
If I try to connect to server that isn't listening, the connect() function
hangs.
I've been looking for something to set a time-out for the connection, but I
can't seem
to find anything.
Is there some way to set a connection time-out? and if so, how?
thanks in advance
 
H

Harbinger of Doom

Victor Bazarov said:
but

Sockets, networking, connections, servers, clients, are
all off-topic here because none of it is part of the LANGUAGE.

Ask in a newsgroup for your OS.

I'm sorry.
I see a lot of people getting mad here because they think something is
off topic.
but just how narrow do you take the "language??"
Forgive me if I'm being blunt, but it's just that I
think that a programming problem in a c++ program
is on topic in a c++ newsgroup.
even if it does concern networking
regards,
HoD
 
V

Victor Bazarov

Harbinger of Doom said:
I'm currently working on a project that needs to send data over a network
I use the SOCKET datatype to do that.
Everything works perfectly, but there's just one problem:
If I try to connect to server that isn't listening, the connect() function
hangs.
I've been looking for something to set a time-out for the connection, but I
can't seem
to find anything.
Is there some way to set a connection time-out? and if so, how?

Sockets, networking, connections, servers, clients, are
all off-topic here because none of it is part of the LANGUAGE.

Ask in a newsgroup for your OS.
 
V

Victor Bazarov

Harbinger of Doom said:
I'm sorry.
I see a lot of people getting mad here because they think something is
off topic.

Mad? What makes you think that?
but just how narrow do you take the "language??"

Narrow? It has an International Standard. That's how we
"take it". If you "take it" differently, you should probably
"take it" elsewhere. Not that you have to. Please stay and
continue posting off-topic if you want. Just don't expect
others to like it.
Forgive me if I'm being blunt, but it's just that I
think that a programming problem in a c++ program
is on topic in a c++ newsgroup.
even if it does concern networking

No, it isn't. This is a _language_ newsgroup. You don't have
a _language_ problem. Your problem has really NOTHING TO DO
with language. Your problem stems from mis-use of networking
tools available on your platform. That's why the best place
to ask about your problem is a newsgroup dedicated to your
platform. It's that simple.

Imagine that I'm writing a program that deals with securities.
And I have a problem where some kind of dividend is not correctly
calculated. Should I also expect an answer here simply because
my program is written in C++? Think before replying, please.

Victor
 
H

Harbinger of Doom

Victor Bazarov said:
Mad? What makes you think that?


Narrow? It has an International Standard. That's how we
"take it". If you "take it" differently, you should probably
"take it" elsewhere. Not that you have to. Please stay and
continue posting off-topic if you want. Just don't expect
others to like it.


No, it isn't. This is a _language_ newsgroup. You don't have
a _language_ problem. Your problem has really NOTHING TO DO
with language. Your problem stems from mis-use of networking
tools available on your platform. That's why the best place
to ask about your problem is a newsgroup dedicated to your
platform. It's that simple.

Imagine that I'm writing a program that deals with securities.
And I have a problem where some kind of dividend is not correctly
calculated. Should I also expect an answer here simply because
my program is written in C++? Think before replying, please.

Victor

OK, that clarifies it a bit.
Now I know what you mean with 'language problems only'
I'm sorry for this OT post.
I'll try to be more careful next time.
regards,
HoD
 
S

Stephen Howe

I see a lot of people getting mad here because they think something is
off topic.
but just how narrow do you take the "language??"
Forgive me if I'm being blunt, but it's just that I
think that a programming problem in a c++ program
is on topic in a c++ newsgroup.

No.

Just the C++ language and the C++ library are on topic. More or less that
means what you can find in the ISO C++ standard. If you can find
"networking" (which you won't) in the standard then it is on-topic.

Basically, hardware-specific (video screens, parallel ports, serial ports,
USB ports, sockets etc), OS-specific (Windows, UNIX, OS/2 etc),
compiler-specific (GCC, VC++, Borland, Sun) questions are off-topic

Stephen Howe
 
H

Hasdrubal Hamilcar

Stephen said:
No.

Just the C++ language and the C++ library are on topic. More or less that
means what you can find in the ISO C++ standard. If you can find
"networking" (which you won't) in the standard then it is on-topic.

Basically, hardware-specific (video screens, parallel ports, serial ports,
USB ports, sockets etc), OS-specific (Windows, UNIX, OS/2 etc),
compiler-specific (GCC, VC++, Borland, Sun) questions are off-topic

His question was probably class-library (MFC) specific.

Hasan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top