WIP: rearrange client code to approach some semblance of modularity someday
This commit is contained in:
parent
a8c5879d21
commit
d4080b78d8
1 changed files with 15 additions and 3 deletions
|
@ -819,10 +819,22 @@ do_projection_common(Sock, ProjCmd) ->
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
w_connect(#p_srvr{proto_mod=?MODULE, address=Host, port=TcpPort}) ->
|
w_connect(#p_srvr{proto_mod=?MODULE, address=Host, port=Port, props=Props})->
|
||||||
try
|
try
|
||||||
Sock = machi_util:connect(Host, TcpPort),
|
case proplists:get_value(session_proto, Props, tcp) of
|
||||||
{w,tcp,Sock}
|
tcp ->
|
||||||
|
Sock = machi_util:connect(Host, Port),
|
||||||
|
{w,tcp,Sock};
|
||||||
|
%% sctp ->
|
||||||
|
%% %% TODO: not implemented
|
||||||
|
%% {w,sctp,Sock}
|
||||||
|
ssl ->
|
||||||
|
%% TODO: veryveryuntested
|
||||||
|
SslOptions = proplists:get_value(ssl_options, Props),
|
||||||
|
Sock = machi_util:connect(Port, Port),
|
||||||
|
{ok, SslSock} = ssl:connect(Sock, SslOptions),
|
||||||
|
{w,ssl,SslSock}
|
||||||
|
end
|
||||||
catch
|
catch
|
||||||
_:_ ->
|
_:_ ->
|
||||||
undefined
|
undefined
|
||||||
|
|
Loading…
Reference in a new issue