Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Borland > IP-stack with U...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 6 Topic 1060 of 1118
Post > Topic >>

IP-stack with UDP sockets now available

by hartnegg <hartnegg@[EMAIL PROTECTED] > Nov 18, 2007 at 12:16 PM

Version 0.9 with udp-sockets is now available on
http://www.klaus-hartnegg.de/pascal/ip

Here's an example that should look familar to people who know socket
programming:

SOCK.CreateSocket (socket, ok);
if not ok then abort ('can not create socket');

adr.IP     := rIP;
adr.****t_p := Udp****tDns;

SOCK.SendTo (socket, adr, sendbuf, sizeof(sendbuf),
             delayed, err);

write ('waiting for reply (abort with keypress) ...');
repeat
   ProcessNet;  { required to do background processing! }
   idle;        { optional to make multitasking operating system
happy }
   SOCK.RecvFrom (socket, false, adr,
                  recvbuf, sizeof(recvbuf), numread, buf_ok, overflow,
err);
   if err.typ <> none then abort (NetMsgFromError(err));
until buf_ok or keypressed;
while keypressed do readkey; { empty keyboard buffer }
writeln;

writeln ('reply received: ',buf_ok);
if buf_ok then
   ShowMemHexAsc (recvbuf,numread);

SOCK.CloseSocket (socket, ok);
if not ok then abort ('can not close socket');
 




 6 Posts in Topic:
Is there any news for this Pascal IP stack
Manil <manil.gaouar@[E  2007-11-14 21:43:51 
Re: Is there any news for this Pascal IP stack
hartnegg <hartnegg@[EM  2007-11-15 00:31:23 
Re: Is there any news for this Pascal IP stack
Dr J R Stockton <jrs@[  2007-11-15 19:41:21 
Re: Is there any news for this Pascal IP stack
Robert Riebisch <Rober  2007-11-16 21:54:07 
Re: Is there any news for this Pascal IP stack
hartnegg <hartnegg@[EM  2007-11-18 01:54:16 
IP-stack with UDP sockets now available
hartnegg <hartnegg@[EM  2007-11-18 12:16:11 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 0:17:56 CDT 2008.