#! /usr/bin/perl
use strict;
use warnings;
use lib qw(lib ../lib);
use IPC::Messaging;

IPC::Messaging->tcp_server(1111);
while (1) {
	receive {
		got tcp_connect => then {
			print "connect from $_[1]->{from}\n";
			print $_ "hi\n";
		};
		got tcp_data => then {
			print "got data: $_[1]->{data}\n";
		};
		got tcp_disconnect => then {
			print "disconnect from $_[1]->{from}\n";
		};
	};
}
