If we had an upvote button on this forum I'd click it. Really really hard.

(…thanks Raul. This is getting copied to where I can find it again in a
couple more years.)



On Thu, 1 Jul 2021 at 20:03, Raul Miller <rauldmil...@gmail.com> wrote:

> You need to understand internet protocols a bit more, before that can work.
>
> Here's a brief overview.
>
> Computers hooked to the internet use a software/hardware stack which
> looks something like this:
>
> application layer (supplies/consumes data)
> transport layer (organizes access to the internet)
> internet layer (identifies addresses and protocol, makes best effort to
> deliver)
> network layer (where all the messy communications happen)
> electrical layer (computers, wires, antenna, all powered on)
> physical layer (the hardware itself)
>
> https://www.w3.org/People/Frystyk/thesis/TcpIp.html
>
> Anyways... host addresses are something for the internet layer. With a
> host address, you can send packets of information and know that they
> will usually but not always reach their destination. (And there will
> be a return address for responses that identifies your machine.)
>
> Also, the socket library gives you direct access to the "transport
> layer". You will almost certainly be using tcp here (which does some
> carefully engineered work to make it appear that you are sending an
> arbitrary lengthy sequence of data and receiving an arbitrary length
> sequence of data -- which is often called a "stream").
>
> For something like stream.data.alpaca.markets/v2/sip you also have a
> protocol that you will need to be specific about. It's probably http,
> but might be https or ftp.
>
> Once you know the protocol (which in this case would also identify the
> transport layer "port" that you need to connect to. That would be 80
> for http, 443 for https and 21 for ftp), you can look up the details
> of how that protocol works.
>
> And, the protocol is where the path part of that address -- the
> /v2/sip part -- is used.
>
> Anyways, there's a lot of details here. If you want to understand
> them... some people are capable of picking up the necessary details
> through self study. But there's also classes which teach this kind of
> thing. (Nowadays, you'll probably also hear a lot of people saying
> it's too complicated to learn, and you should use a prepackaged
> implementation. Whether or not you follow their footsteps or dive in
> and do it yourself is up to you. That said, it's probably also worth
> noting that most of the unnecessary complicated stuff falls into
> disuse after a few years because it's too complicated to learn.)
>
> Good luck,
>
> --
> Raul
>
> On Thu, Jul 1, 2021 at 2:44 PM Ed Gottsman <edward.j.gotts...@gmail.com>
> wrote:
> >
> > Hello.  I've begun working with the socket library.  I can use it to
> resolve host names:
> >
> > sdgethostbyname 'stream.data.alpaca.markets'
> >
> > ┌─┬─┬────────────┐
> > │0│2│38.122.35.99│
> > └─┴─┴────────────┘
> >
> > Unfortunately, both the code (to the extent that I've been able to
> understand it) and the documentation suggest that only a "raw" host can be
> used to identify an endpoint.  So, for example, there seems to be no way to
> connect to
> >
> > 'stream.data.alpaca.markets/v2/sip' or '38.122.35.99/v2/sip'
> >
> > ...which is what I'd like to do.
> >
> > I've mucked around trying to hit the DLL more directly--just passing it
> a url--but it's a pretty desperate approach and unlikely to succeed.  I'd
> very much appreciate any ideas the community might have.
> >
> > Btw: I checked the nabble archive for an answer and all the emails’
> contents read, “…the author has deleted this message.”  So while the nabble
> search engine did turn up a lot of socket traffic (which is encouraging),
> it wasn’t of much help.
> >
> > Thank you.
> >
> > Ed
> >
> > Sent from my iPad
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to