comp.lang.ada
 help / color / mirror / Atom feed
* A few questions on parsing, sockets, UTF-8 strings
@ 2016-08-11 14:39 john
  2016-08-11 16:23 ` Dmitry A. Kazakov
  0 siblings, 1 reply; 7+ messages in thread
From: john @ 2016-08-11 14:39 UTC (permalink / raw)


Hi! For some non-standard interprocess communication, I need to:

1. Listen with a TCP socket to the local loopback interface and obtain the PORT suggested by the OS, i.e. like with bind() to port 0 and getsockname() in C. Is this possible with GNAT.sockets?

2. Connect to the incoming host and parse input and send output delimited by LF line-by-line. What about buffering, can it be switched off or is there a line buffer mode already? (It needs to be compatible with LF instead of CR+LF as delimiter, though.) 

3. Convert back and forth between Base64-encoded UTF-8 strings and UTF-8 strings (which may also be represented in the source text). How do I do this?

Especially the last point is a bit mysterious to me. I cannot use UCS-2, it needs to be full UTF-8. Should I use a library for UTF-8 strings? Which one? 

Speed is not very important, but I'd like to avoid unnecessary conversions.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-08-11 21:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-11 14:39 A few questions on parsing, sockets, UTF-8 strings john
2016-08-11 16:23 ` Dmitry A. Kazakov
2016-08-11 17:40   ` john
2016-08-11 17:49     ` Dmitry A. Kazakov
2016-08-11 18:22       ` john
2016-08-11 19:09         ` gautier_niouzes
2016-08-11 21:10         ` Dmitry A. Kazakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox