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

socket problem

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

--
Harbinger of Doom
Jul 19 '05 #1
6 2870
"Harbinger of Doom" <sl******@pandora.be> wrote...
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.
Jul 19 '05 #2

"Victor Bazarov" <v.********@attAbi.com> schreef in bericht
news:vg************@corp.supernews.com...
"Harbinger of Doom" <sl******@pandora.be> wrote...
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.


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
Jul 19 '05 #3
"Harbinger of Doom" <sl******@pandora.be> wrote...

"Victor Bazarov" <v.********@attAbi.com> schreef in bericht
news:vg************@corp.supernews.com...
"Harbinger of Doom" <sl******@pandora.be> wrote...
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.


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
Jul 19 '05 #4

"Victor Bazarov" <v.********@attAbi.com> schreef in bericht
news:vg************@corp.supernews.com...
"Harbinger of Doom" <sl******@pandora.be> wrote...

"Victor Bazarov" <v.********@attAbi.com> schreef in bericht
news:vg************@corp.supernews.com...
"Harbinger of Doom" <sl******@pandora.be> wrote...
> 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.


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


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
Jul 19 '05 #5
> 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
Jul 19 '05 #6
Stephen Howe wrote:
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


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

Hasan
Stephen Howe


Jul 19 '05 #7

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

Similar topics

3
by: Thomas Hervé | last post by:
My problem is not really python specific but as I do my implementation in python I hope someone here can help me. I have two programs that talk through a socket. Here is the code : <server>...
4
by: Bryan Olson | last post by:
Here's the problem: Suppose we use: import socket f = some_socket.makefile() Then: f.read() is efficient, but verbose, and incorrect (or at least does not play will with others);
4
by: faktujaa | last post by:
Hi, I am having some problem with callback used in socket implementation. private static void Connect(string strPrtrIPAddr, int intPrtrPort, ref Socket rsocClient) { try { // Create remote end...
4
by: zbcong | last post by:
Hello: I write a multithread c# socket server,it is a winform application,there is a richtextbox control and button,when the button is click,the server begin to listen the socket port,waiting for a...
4
by: Chris Tanger | last post by:
Context: C# System.Net.Sockets Socket created with constructor prarmeters Internetwork, Stream and TCP everything else is left at the default parameters and options except linger may be changed...
4
by: Sa¹o Zagoranski | last post by:
Hi! I'm writing a simple 3D First person shooter game. It is a multiplayer game, where all the players connect to one server.
11
by: atlaste | last post by:
Hi, In an attempt to create a full-blown webcrawler I've found myself writing a wrapper around the Socket class in an attempt to make it completely async, supporting timeouts and some scheduling...
6
by: ahlongxp | last post by:
socket.makefile() may lose data when "connection reset by peer". and socket.recv() will never lose the data. change the "1" to "0" in the client code to see the difference. confirmed on both...
0
by: george585 | last post by:
Hello! I am new to network programming, and understand just basics. Using some sample code, and having read documentation, I managed to create a simple app in C# and VB.NET. The application is...
16
by: =?iso-8859-1?q?|-|e|=5F|=5F_B0=DD?= | last post by:
hi all! I got a problem. I declared a SOCKET var in my C program but when i compiled the program it displayed like *--------------------------------------------------------------* *'SOCKET':...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...

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.