BBC BASIC for Windows
« UDP »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 10:13pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: UDP  (Read 1212 times)
Gary
Guest
xx UDP
« Thread started on: Dec 10th, 2010, 12:47pm »

How can I send and receive UDP packets?
User IP Logged

wizzie
New Member
Image


member is offline

Avatar




PM


Posts: 1
xx Re: UDP
« Reply #1 on: Dec 10th, 2010, 12:50pm »

Good question?

Can BB4W only supprt FTP?
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: UDP
« Reply #2 on: Dec 10th, 2010, 1:21pm »

on Dec 10th, 2010, 12:50pm, wizzie wrote:
Can BB4W only supprt FTP?

Do you mean TCP? Anyway, the answer (as always) is that BBC BASIC for Windows is a general purpose programming language, and it can do anything (within reason) that any other Windows programming language can. So, of course, it can do UDP as well as TCP.

Richard.
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: UDP
« Reply #3 on: Dec 10th, 2010, 1:29pm »

on Dec 10th, 2010, 12:47pm, Guest-Gary wrote:
How can I send and receive UDP packets?

You can either write your own code, calling API functions in WSOCK32.DLL or WS2_32.DLL directly, or you can adapt the existing SOCKLIB.BBC library to open a UDP socket rather than a TCP socket.

For example in the FN_tcpconnect function you can see that the protocol is specified by passing the constant IPPROTO_TCP (6) to the socket API. By passing IPPROTO_UDP (17) instead, with perhaps a few other minor changes (like changing SOCK_STREAM to SOCK_DGRAM), you can access the UDP interface.

Ask again if you don't feel confident to make the necessary changes.

Richard.
User IP Logged

knudvaneeden
Developer

member is offline

Avatar




Homepage PM


Posts: 32
xx Re: UDP
« Reply #4 on: Dec 14th, 2010, 08:24am »

It would be very interesting to see working source code for UDP in BBCBASIC for Windows also.

Thanks.

with friendly greetings, Knud van Eeden
User IP Logged

Gary
Guest
xx Re: UDP
« Reply #5 on: Dec 14th, 2010, 12:05pm »

Thanks
Ill have a go and see what I cab break(Now I have full version of BB4W wink)
I found WINDUMP untility so I can look at the other end of the connection to see what emerges.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls