Re: [1/2OT] a buggy TCP client program
- From: jaysome <jaysome@xxxxxxxxxxx>
- Date: Wed, 19 Dec 2007 00:05:37 -0800
On Tue, 18 Dec 2007 09:20:53 +0100, RoS <Ros@xxxxxxxxx> wrote:
in windows xp
the problem is that if i have a tcp sever istalled in the port 1000 in
my computer, and "cli.exe" is the C program "client program" below and
type
cli 127.1.1.1 1000
connect of client fail with "WSAECONNREFUSED 10061"
don't understand why
there is someone expert in this there?
what is the answer?
then there is someone can point out some C program for the use api
"ReadFile" with an handle return by api "socket"?
thank you
----------------------------------------------------
#include <WINSOCK2.H>
#include <stdio.h>
#include <windows.h>
#include <winbase.h>
#include <wincon.h>
Only 1 out of 5 of these headers are standard C headers. The rest are
specific to Microsoft Windows. This newsgroup is about discussing
topics related to Standard C, and has nothing to do with
Windows-specific or any other OS-specific matters.
#define P printf
#define R return
#define F for
#define G goto
#define uns unsigned
These #defines are absolutely horrendous, to an exponential degree.
Think about it--anyone who reads your code and sees a use of these
#defines will immediately have to go back to these #defines to see
what they mean.
You, in your own mind, may have memorized that "P" means "printf" and
"F" means "for", but can you really expect that the readers of your
code can be trained to memorize these like you? I know I can't--and
won't.
And what was it that you think you really accomplished with these
#defines? These types of things belong in an obfuscation code contest,
not in real-world code.
[rest snipped because off-topicality]
--
jay
.
- Follow-Ups:
- Re: [1/2OT] a buggy TCP client program
- From: Keith Thompson
- Re: [1/2OT] a buggy TCP client program
- From: santosh
- Re: [1/2OT] a buggy TCP client program
- References:
- [1/2OT] a buggy TCP client program
- From: RoS
- [1/2OT] a buggy TCP client program
- Prev by Date: Re: Positive random number
- Next by Date: Re: Positive random number
- Previous by thread: Re: [1/2OT] a buggy TCP client program
- Next by thread: Re: [1/2OT] a buggy TCP client program
- Index(es):
Relevant Pages
|