Comments (7)
The main issue is how to manage a "huge" mass of data, related to a Commodore 64. It's possible to paginate by number of bytes, but not by lines.
Maybe we can read chunks of byte 'till is reached a given number of "CR" occurrences.
from ultimateii-dos-lib.
Tried with this trivial code to make a "GET HTTP/1.1", but I got no result (just "-1" as data count): what do I do wrong?
void main(void)
{
char buff[400];
int i;
uii_identify();
uii_getipaddress();
uii_settarget(TARGET_NETWORK);
uii_tcpconnect("cbbsoutpost.servebbs.com", 80);
socketnr = uii_data[0];
printf("FASE 1-----------------\n");
strcpy(buff,"GET /api/exportbbslist/service.php?f=csv HTTP/1.1\n\n");
uii_tcpsocketwrite(socketnr, buff);
printf("FASE 2-----------------\n");
for (i=0; i<50; ++i) {
uii_tcpsocketread(socketnr, 892);
datacount = uii_data[0] | (uii_data[1]<<8);
printf("%d ",datacount);
if(datacount > 0)
printf("%s",uii_data+2);
}
}
from ultimateii-dos-lib.
Tried also:
strcpy(buff,"get /API/EXPORTBBSLIST/SERVICE.PHP?F=CSV http/1.1\n\n");
...but I get the same result (=no result)
from ultimateii-dos-lib.
Try changing to 1.0:
GET /api/exportbbslist/service.php?f=csv HTTP/1.0\n\n
works via telnet client for me. I think something about 1.1 has an additional requirement.
from ultimateii-dos-lib.
just tried this, I added an "experiment" folder:
https://github.com/xlar54/ultimateii-dos-lib/tree/download_with_punter_protocol/experiments
try compiling it with:
cl65 -O ultimate_ii.c net.c -o net.prg
and launch net.prg on the C64/1541u2+
It do not print anything: why?
from ultimateii-dos-lib.
fixed in recent check in
from ultimateii-dos-lib.
I have extended Ultimate_II APIs with a BufferedReader of the TCP Socket, with this extension I implemented a POC of this issue's subject with a few, clean code:
https://github.com/xlar54/ultimateii-dos-lib/blob/download_with_punter_protocol/sandbox/net.c
uii_tcpsocketwrite_ascii(socket, "GET /api/exportbbslist/service.php?f=csv HTTP/1.0\n\n");
// Skip HTTP header
while (uii_tcp_nextline_ascii(socket, buff) && *buff);
//Skip first line (header)
uii_tcp_nextline_ascii(socket, buff);
// Read single lines
while (uii_tcp_nextline_ascii(socket, buff) && *buff) {
p1 = strchr(buff+1, ',');
p2 = strchr(p1+1, ',');
p3 = strchr(p2+1, ',');
strncpy(name, buff+1, (p1-buff));
name[p1-buff-2]=0;
strncpy(host, p1+2, (p2-p1)-2);
host[p2-p1-3]=0;
strncpy(port, p2+2, (p3-p2)-2);
port[p3-p2-3]=0;
printf("%s:%s\n", host, port);
}
uii_tcpclose(socket);
You can run "net.prg" on the C64 and have listed all BBSes registered on the site. The main problem I see is the slowness, despite the reading is actually buffered, 892 bytes at a time.
from ultimateii-dos-lib.
Related Issues (20)
- UltimateChat - Add timestamp option
- UltimateChat - Utilize REU for scrollback buffer
- UltimateTerm - Ability to abort xmodem download HOT 1
- UltimateTerm : X-Modem support HOT 2
- Loader: Simple menu of applications
- UltimateTerm - Change bug reports location HOT 1
- UltimateTerm - DOS commands HOT 1
- UltimateTerm - Bell fix HOT 1
- VT100/ANSI HOT 19
- ultimate_lib - use of malloc without free HOT 2
- ultimate_lib - Mishandling of _ in URL when send over network with uii_tcpsocketwrite_ascii
- UDP and GET_TIME HOT 4
- All IP parameters are 255.255.255.255 in u-chat64 at 48MHz HOT 4
- Implement Punter - Download protocol
- geos
- Sample program not working with U2+ Updated to Latest Firmware HOT 4
- Incomplete XMODEM implementation Ultimate Term. What about CRC / 1K / Resending bad Blocks etc. ? HOT 1
- U-SHELL doesn't work.. HOT 9
- uii_socketwrite() function has no data length parameter HOT 1
- irc server password support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ultimateii-dos-lib.