TCP/IP sample code

  • Follow


The VO "Ping" sample is a very interesting application. Does anyone
know who wrote this program and how to get in touch with him or her? I
would like to expand this for more general tcp/ip communication. For
example, in the TCPIP:Init() there are strange commands like "try" and
"affirm" (see below). Does anyone know where these originate from?
METHOD init CLASS TCPIP	
try
SELF:cLastError		:= ""		// no errormsg to start
SELF:nErrCode		:= 0		// no error to start
SELF:nTimeout 		:= 2000   	// time IN miliseconds
SELF:nSize		:= 56		// default packet size
SELF:nTimeToLive	:= 64		// default TTL

affirm(SELF:Startwinsock())
SetLastError(0)
	
SELF:hFile		:= IcmpCreateFile()
IF  SELF:hFile == INVALID_HANDLE_VALUE	
	SELF:nErrCode		:= GetLastError()
	// see if we had an error
	SELF:cLastError 	:= "Unable to Create File Handle"
ENDIF
endtrynoreturncatch
RETURN SELF
0
Reply Kees 1/4/2010 1:23:16 PM

Hey,

I did the sample for ping and nbtstat. The try is in a udc. It covers =
the=20
error handling setup and breakdown.

Regards,
Willie

"Kees Bouw" <kees@nospam.ic2.com> wrote in message=20
news:iiq3k55q66bididlsscm8g37to2b3hah51@4ax.com...
> The VO "Ping" sample is a very interesting application. Does anyone
> know who wrote this program and how to get in touch with him or her? I
> would like to expand this for more general tcp/ip communication. For
> example, in the TCPIP:Init() there are strange commands like "try" and
> "affirm" (see below). Does anyone know where these originate from?
> METHOD init CLASS TCPIP
> try
> SELF:cLastError :=3D "" // no errormsg to start
> SELF:nErrCode :=3D 0 // no error to start
> SELF:nTimeout :=3D 2000   // time IN miliseconds
> SELF:nSize :=3D 56 // default packet size
> SELF:nTimeToLive :=3D 64 // default TTL
>
> affirm(SELF:Startwinsock())
> SetLastError(0)
>
> SELF:hFile :=3D IcmpCreateFile()
> IF  SELF:hFile =3D=3D INVALID_HANDLE_VALUE
> SELF:nErrCode :=3D GetLastError()
> // see if we had an error
> SELF:cLastError :=3D "Unable to Create File Handle"
> ENDIF
> endtrynoreturncatch
> RETURN SELF
>
> __________ Information from ESET NOD32 Antivirus, version of virus=20
> signature database 4742 (20100104) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
> 

__________ Information from ESET NOD32 Antivirus, version of virus signatur=
e database 4742 (20100104) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



0
Reply Willie 1/4/2010 2:25:59 PM


Hi Kees,

Happy newyear!

The sample is written by Uwe Holtz I think, a member of the former VO 
devteam. If you really need to get in touch with him, I think I do have his 
emailaddress somewhere. Write me in private for this, I have the feeling he 
will not be very amused by putting this in a newsgroup message....

VO commands? VO does not have commands, but does have a powerfull 
preprocessor. Look at STD.UDF
So if you look at the application properties, you'll see what file defines 
the used User-defined commands involved.

hth

Erik




"Kees Bouw" <kees@nospam.ic2.com> schreef in bericht 
news:iiq3k55q66bididlsscm8g37to2b3hah51@4ax.com...
> The VO "Ping" sample is a very interesting application. Does anyone
> know who wrote this program and how to get in touch with him or her? I
> would like to expand this for more general tcp/ip communication. For
> example, in the TCPIP:Init() there are strange commands like "try" and
> "affirm" (see below). Does anyone know where these originate from?
> METHOD init CLASS TCPIP
> try
> SELF:cLastError := "" // no errormsg to start
> SELF:nErrCode := 0 // no error to start
> SELF:nTimeout := 2000   // time IN miliseconds
> SELF:nSize := 56 // default packet size
> SELF:nTimeToLive := 64 // default TTL
>
> affirm(SELF:Startwinsock())
> SetLastError(0)
>
> SELF:hFile := IcmpCreateFile()
> IF  SELF:hFile == INVALID_HANDLE_VALUE
> SELF:nErrCode := GetLastError()
> // see if we had an error
> SELF:cLastError := "Unable to Create File Handle"
> ENDIF
> endtrynoreturncatch
> RETURN SELF 

0
Reply iso 1/4/2010 2:33:22 PM

2 Replies
395 Views

(page loaded in 0.041 seconds)

Similiar Articles:













7/30/2012 9:33:04 AM


Reply: