Re: Recieve packet from socket in Erlang active mode with ASCII packet size header

zxq9 <[email protected]>
Newsgroups gmane.comp.lang.erlang.general
Message-ID <[email protected]>
On 2021/01/05 23:51, zxq9 wrote:
> Hi, George.
> 
> Reply is below.

Ah... in the previous response I forgot to mention what was going on in 
the state record (the ubiquitous  #s{}...). It would be something like:

-record(s,
         {ssl             :: term(), % whatever_type_ssl_is(),
          protocol        :: term(), % probably_an_atom(),
          socket          :: gen_tcp:socket() | ssl:sslsocket(),
          left     = none :: none | pos_integer(),
          acc      = none :: none | binary()}).


Or whatever you need to have in there. Once a tuple grows past about 3 
or 4 members I tend to make them records except for special 
circumstances (and nearly always in the case of a state record).

-Craig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.