Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 57 lines (44 sloc) 1.831 kb
ad09b084 »
2012-09-07 add tcp6/ssl6 transport modules + define behaviour
1 %%%
2 %%% Copyright 2012 © Nicolas Niclausse
3 %%%
4 %%% Author : Nicolas Niclausse <nicolas.nniclausse@niclux.org>
5 %%% Created: 7 sep 2012 by Nicolas Niclausse <nicolas.nniclausse@niclux.org>
6 %%%
7 %%% This program is free software; you can redistribute it and/or modify
8 %%% it under the terms of the GNU General Public License as published by
9 %%% the Free Software Foundation; either version 2 of the License, or
10 %%% (at your option) any later version.
11 %%%
12 %%% This program is distributed in the hope that it will be useful,
13 %%% but WITHOUT ANY WARRANTY; without even the implied warranty of
14 %%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 %%% GNU General Public License for more details.
16 %%%
17 %%% You should have received a copy of the GNU General Public License
18 %%% along with this program; if not, write to the Free Software
19 %%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
20 %%%
21 %%% In addition, as a special exception, you have the permission to
22 %%% link the code of this program with any library released under
23 %%% the EPL license and distribute linked combinations including
24 %%% the two.
25
26 -module(ts_tcp6).
27
28 -export([ connect/3, send/3, close/1, set_opts/2, protocol_options/1, normalize_incomming_data/2 ]).
29
30 -behaviour(gen_ts_transport).
31
32 -include("ts_profile.hrl").
33 -include("ts_config.hrl").
34
35 protocol_options(Opts) ->
36 [inet6]++ts_tcp:protocol_options(Opts).
37
38 connect(Host, Port, Opts) ->
39 gen_tcp:connect(Host, Port, Opts).
40
41 %% send/3 -> ok | {error, Reason}
42 send(Socket, Data, _Opts) ->
43 gen_tcp:send(Socket, Data).
44
45 close(Socket) ->
24213b0d »
2012-09-07 minor
46 ts_tcp:close(Socket).
ad09b084 »
2012-09-07 add tcp6/ssl6 transport modules + define behaviour
47
48 % set_opts/2 -> socket()
49 set_opts(Socket, Opts) ->
50 inet:setopts(Socket, Opts),
51 Socket.
52
53 normalize_incomming_data(Socket,Data) ->
54 ts_tcp:normalize_incomming_data(Socket,Data).
55
56
Something went wrong with that request. Please try again.