summaryrefslogtreecommitdiff
path: root/test/erl
diff options
context:
space:
mode:
authorDavid Reiss <dreiss@apache.org>2008-06-11 00:57:54 +0000
committerDavid Reiss <dreiss@apache.org>2008-06-11 00:57:54 +0000
commit8cf694d62d314de3501872656a662a825ff6c98d (patch)
treebe47de8fbf4dc18fd480df6c3df92b09b5aacf77 /test/erl
parent5541d658643bbd2c2e1c62ee489e25a7706b9d62 (diff)
downloadthrift-8cf694d62d314de3501872656a662a825ff6c98d.tar.gz
Change alterl thrift_server to use non-blocking TCP calls and properly set the processor as the controlling process for the client sockets.
Summary: - Removes the non-OTP "acceptor" process - The processor becomes the socket's controlling process instead of the transport, which is kind of messy, but it means we don't have to make a process for the socket_transport. - See http://www.trapexit.org/Building_a_Non-blocking_TCP_server_using_OTP_principles for non-blocking server info Test plan: - Ran ThriftTest and StressTest git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666417 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/erl')
-rw-r--r--test/erl/Makefile2
-rw-r--r--test/erl/src/stress_server.erl21
2 files changed, 2 insertions, 21 deletions
diff --git a/test/erl/Makefile b/test/erl/Makefile
index 017cdc1ac..42572d222 100644
--- a/test/erl/Makefile
+++ b/test/erl/Makefile
@@ -7,7 +7,7 @@ INCLUDEDIR=include
TARGETDIR=ebin
SRCDIR=src
-ALL_INCLUDEDIR=$(GEN_INCLUDEDIR) $(INCLUDEDIR) ../../lib/erl/include
+ALL_INCLUDEDIR=$(GEN_INCLUDEDIR) $(INCLUDEDIR) ../../lib/alterl/include
INCLUDEFLAGS=$(patsubst %,-I%, ${ALL_INCLUDEDIR})
MODULES = stress_server test_server
diff --git a/test/erl/src/stress_server.erl b/test/erl/src/stress_server.erl
index 915b027ea..d82f9405b 100644
--- a/test/erl/src/stress_server.erl
+++ b/test/erl/src/stress_server.erl
@@ -1,8 +1,7 @@
-module(stress_server).
--include("thrift.hrl").
--export([start_link/1, old_start_link/1,
+-export([start_link/1,
handle_function/2,
@@ -19,24 +18,6 @@
start_link(Port) ->
thrift_server:start_link(Port, service_thrift, ?MODULE).
-% Start the server with the old style bindings
-old_start_link(Port) ->
- Handler = ?MODULE,
- Processor = service_thrift,
-
- TF = tBufferedTransportFactory:new(),
- PF = tBinaryProtocolFactory:new(),
-
- ServerTransport = tErlAcceptor,
- ServerFlavor = tErlServer,
-
- Server = oop:start_new(ServerFlavor, [Port, Handler, Processor, ServerTransport, TF, PF]),
-
- case ?R0(Server, effectful_serve) of
- ok -> Server;
- Error -> Error
- end.
-
handle_function(Function, Args) ->
case apply(?MODULE, Function, tuple_to_list(Args)) of