@LIBRARY=SILC Utility Library
@FILENAME=silcutillib.html
@LINK=silctypes.html:Basic SILC Types
-@LINK=silcbuffer.html:SILC Buffer Interface
-@LINK=silcbuffmt.html:SILC Buffer Format Interface
-@LINK=silchashtable.html:SILC Hash Table Interface
-@LINK=silclog.html:SILC Logging Interface
-@LINK=silcmemory.html:SILC Memory Interface
-@LINK=silcthread.html:SILC Thread Interface
-@LINK=silcmutex.html:SILC Mutex Interface
-@LINK=silccond.html:SILC Conditional Variable Interface
-@LINK=silcatomic.html:SILC Atomic Operations Interface
-@LINK=silcnet.html:SILC Network Interface
-@LINK=silcschedule.html:SILC Schedule Interface
-@LINK=silcsockconn.html:SILC Socket Interface
-@LINK=silcprotocol.html:SILC Protocol Interface
-@LINK=silcconfig.html:SILC Config Interface
-@LINK=silcfileutil.html:SILC File Util Interface
-@LINK=silcstrutil.html:SILC String Util Interface
-@LINK=silcutf8.html:SILC UTF-8 Interface
-@LINK=silcstringprep.html:SILC Stringprep Interface
-@LINK=silcutil.html:SILC Util Interface
-@LINK=silclist.html:SILC List Interface
-@LINK=silcdlist.html:SILC Dynamic List Interface
+@LINK=silcbuffer.html:Data Buffer Interface
+@LINK=silcbuffmt.html:Data Buffer Format Interface
+@LINK=silchashtable.html:Hash Table Interface
+@LINK=silcmemory.html:Memory Allocation Interface
+@LINK=silcstack.html:Data Stack (memory pool) Interface
+@LINK=silcthread.html:Thread Interface
+@LINK=silcmutex.html:Mutual Exclusion Lock Interface
+@LINK=silccond.html:Conditional Variable Interface
+@LINK=silcatomic.html:Atomic Operations Interface
+@LINK=silcnet.html:Network (TCP and UDP) Interface
+@LINK=silcschedule.html:Scheduler Interface
+@LINK=silcsocketstream.html:Socket Stream Interface
+@LINK=silcfdstream.html:File Descriptor Stream Interface
+@LINK=silcstream.html:Abstract Stream Interface
+@LINK=silcfsm.html:Finite State Machine Interface
+@LINK=silcfileutil.html:File Utility Functions
+@LINK=silcstrutil.html:String Utility Interface
+@LINK=silcutf8.html:UTF-8 String Interface
+@LINK=silcstringprep.html:Stringprep Interface
+@LINK=silcutil.html:Utility Functions
+@LINK=silclist.html:List Interface
+@LINK=silcdlist.html:Dynamic List Interface
+@LINK=silcasync.html:Asynchronous Operation Interface
+@LINK=silcmime.html:MIME Interface
+@LINK=silctime.html:Time Utility Functions
+@LINK=silclog.html:Logging Interface
+@LINK=silcconfig.html:Config File Interface
-->
<big><b>SILC Utility Library</b></big>
SilcFSM fsm;
SilcFSMSemaStruct sema;
SilcFSMThreadStruct thread;
- SilcNetServer server;
+ SilcNetListener server;
SilcStream client_stream;
SilcNetStatus client_status;
SilcStream server_stream;
SILC_LOG_DEBUG(("test_st_connect"));
SILC_LOG_DEBUG(("Connecting to server"));
- silc_fsm_next(fsm, test_st_connected, NULL);
+ silc_fsm_next(fsm, test_st_connected);
SILC_FSM_CALL(silc_net_tcp_connect(NULL, "localhost", 5000,
silc_fsm_get_schedule(fsm),
test_connected, f));
SILC_LOG_DEBUG(("test_st_start"));
SILC_LOG_DEBUG(("Creating network listener"));
- f->server = silc_net_create_server(NULL, 0, 5000, FALSE,
+ f->server = silc_net_tcp_create_listener(NULL, 0, 5000, TRUE, TRUE,
silc_fsm_get_schedule(fsm),
test_accept_connection, f);
if (!f->server) {
/** Creating network listener failed */
SILC_LOG_DEBUG(("Listener creation failed"));
- silc_fsm_next(fsm, test_st_finish, NULL);
+ silc_fsm_next(fsm, test_st_finish);
return SILC_FSM_CONTINUE;
}
/* Create thread to connect to the listener */
silc_fsm_thread_init(&f->thread, fsm, f, NULL, NULL, FALSE);
- silc_fsm_start(&f->thread, test_st_connect, NULL);
+ silc_fsm_start(&f->thread, test_st_connect);
/** Start waiting connection */
SILC_LOG_DEBUG(("Start waiting for incoming connections"));
silc_fsm_sema_init(&f->sema, fsm, 0);
- silc_fsm_next(fsm, test_st_second, NULL);
+ silc_fsm_next(fsm, test_st_second);
return SILC_FSM_CONTINUE;
}
if (f->client_status != SILC_NET_OK) {
/** Accepting new connection failed */
SILC_LOG_DEBUG(("Accepting failed %d", f->client_status));
- silc_fsm_next(fsm, test_st_finish, NULL);
+ silc_fsm_next(fsm, test_st_finish);
return SILC_FSM_CONTINUE;
}
silc_socket_stream_get_info(f->client_stream, NULL, &host, &ip, &port);
SILC_LOG_DEBUG(("Accepted new connection %s, %s:%d", host, ip, port));
- /** Finish */
+ /** Wait thread to terminate */
f->success = TRUE;
- silc_fsm_next(fsm, test_st_finish, NULL);
- return SILC_FSM_CONTINUE;
+ silc_fsm_next(fsm, test_st_finish);
+ SILC_FSM_THREAD_WAIT(&f->thread);
}
SILC_FSM_STATE(test_st_finish)
}
SILC_LOG_DEBUG(("Closing network listener"));
- silc_net_close_server(f->server);
+ silc_net_close_listener(f->server);
SILC_LOG_DEBUG(("Finish machine"));
return SILC_FSM_FINISH;
fsm = silc_fsm_alloc(f, destructor, NULL, schedule);
if (!fsm)
goto err;
- silc_fsm_start(fsm, test_st_start, NULL);
+ silc_fsm_start(fsm, test_st_start);
f->fsm = fsm;
SILC_LOG_DEBUG(("Running scheduler"));