[Opensrf-commits] r1213 - trunk/src/libopensrf

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Jan 15 10:09:06 EST 2008


Author: erickson
Date: 2008-01-15 09:43:40 -0500 (Tue, 15 Jan 2008)
New Revision: 1213

Removed:
   trunk/src/libopensrf/component.c
Log:
removing old, unused code

Deleted: trunk/src/libopensrf/component.c
===================================================================
--- trunk/src/libopensrf/component.c	2008-01-15 04:03:07 UTC (rev 1212)
+++ trunk/src/libopensrf/component.c	2008-01-15 14:43:40 UTC (rev 1213)
@@ -1,52 +0,0 @@
-#include <opensrf/transport_client.h>
-#include "signal.h"
-
-
-/*
-void print_stuff(void* blah, char* data) {
-	fprintf(stderr, "Received from socket: %s\n", data);
-}
-*/
-
-/* connects and registers with the router */
-int main( int argc, char** argv ) {
-
-
-
-	if( argc < 5 ) {
-		osrfLogError(OSRF_LOG_MARK,  "Usage: %s <server> <port> <name> <secret>", argv[0] );
-		return -1;
-	}
-
-	int port = atoi(argv[2]);
-	transport_client* client = client_init( argv[1], port, 1 );
-
-	// try to connect, allow 15 second connect timeout 
-	if( client_connect( client, argv[3], argv[4], "", 15, 1 ) ) 
-		osrfLogInfo(OSRF_LOG_MARK, "Connected...\n");
-	 else  {
-		osrfLogError(OSRF_LOG_MARK,  "NOT Connected...\n" ); 
-		return -1;
-	 }
-	
-	transport_message* recv;
-	while( (recv=client_recv( client, -1)) ) {
-		if( recv->is_error )
-			fprintf( stderr, "\nReceived Error\t: ------------------\nFrom:\t\t"
-				"%s\nRouterFrom:\t%s\nBody:\t\t%s\nType %s\nCode %d\n=> ", 
-				recv->sender, recv->router_from, recv->body, recv->error_type, recv->error_code );
-		else
-			fprintf( stderr, "\nReceived\t: ------------------\nFrom:\t\t"
-				"%s\nRouterFrom:\t%s\nBody:\t\t%s\n=> ", recv->sender, recv->router_from, recv->body );
-		transport_message* send = message_init( "Hello...", "", "123454321", recv->sender, argv[3] );
-		client_send_message( client, send );
-		message_free( recv );
-		message_free( send );
-	}
-	return 0;
-
-}
-
-
-
-



More information about the opensrf-commits mailing list