BBC BASIC
« UDP support »

Welcome Guest. Please Login or Register.
Mar 31st, 2018, 11:10pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Cross-platform BBC BASIC (Windows, Linux x86, Mac OS-X, Android, iOS, Raspberry Pi)
BBC BASIC Resources
BBC BASIC Help Documentation
BBC BASIC for Windows Home Page
BBC BASIC Programmers' Reference
BBC BASIC Beginners' Tutorial
BBC BASIC for SDL 2.0 Home Page
BBC BASIC Discussion Group

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: UDP support  (Read 396 times)
movr0r0
New Member
Image


member is offline

Avatar




PM


Posts: 6
xx Re: UDP support
« Reply #4 on: Nov 29th, 2017, 4:48pm »

Hi Richard,
sorry for this slow update;

So I have amended BB4W SOCKLIB library with a few simple things, mostly UDP client/server additions, as well as a few things concerning TCP -- taking care however to keep it fully backwards compatible with the stock version (and to use look-alike naming for added functions smiley.

Basically, additions are:
REM FN_tcplistenM(host$,port$,backlog) Create a TCP/IP listening socket (with backlog, i.e. allows multiple connections requests)
REM FN_checkconnectionM(socket) Check for a connection request and actually connects client (and leave listening socket open for more connections)
REM FN_udpsocketS(host$,port$) Create a UDP/IP service socket (explicit bind, server application)
REM FN_udpsocketC(host$,port$) Create a UDP/IP service socket (implicit bind, client application)
REM FN_readsocketfrom(skt,buf,len,sockaddrbuf,sockaddrbuflen) Read max 'len' bytes to addr 'buf' from 'skt', and get peer's details
REM FN_writesocketto(skt,buf,len,sockaddrbuf,sockaddrbuflen) Write max 'len' bytes at addr 'buf' to 'skt', specifying peer

I am not sure if you want me to send you the source code, or how to submit this new version. Let me know.

Ah, by the way, is there a better (shorter) way to get the base address of a structure than actually getting the address of its very first member?

User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 803
xx Re: UDP support
« Reply #5 on: Nov 29th, 2017, 6:47pm »

on Nov 29th, 2017, 4:48pm, movr0r0 wrote:
I am not sure if you want me to send you the source code

Please do. As I mentioned before, SOCKLIB is one of the oldest libraries and contains 'obsolete' code so will need some attention before a new version could be released. I also want to keep the BBCSDL version of SOCKLIB 'in phase' with the BB4W version, so that implies the addition of compatible UDP functions to the former.

Quote:
is there a better (shorter) way to get the base address of a structure than actually getting the address of its very first member?

If I'm understanding the question, is there some reason why you're not simply using struct{} ?

http://www.bbcbasic.co.uk/bbcwin/manual/bbcwin2.html#structapi

Richard.
User IP Logged

movr0r0
New Member
Image


member is offline

Avatar




PM


Posts: 6
xx Re: UDP support
« Reply #6 on: Dec 4th, 2017, 1:28pm »

Hello Richard.

no, there is no (admittable) reason why I haven't used struct{} smiley

I'll email you the amended SOCKLIB.BBC library in a few minutes.

Cheers,
Phil.
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