Example #1
0
int _main(void)
{
	// Init and resolve libraries
	initKernel();
	initLibc();
	initNetwork();
	initPthread();

	// Init netdebug
	struct sockaddr_in server;
	server.sin_family = sceNetHtons(AF_INET);
	server.sin_addr.s_addr = IP(192, 168, 0, 4);
	server.sin_port = sceNetHtons(9023);
	memset(server.sin_zero, 0, sizeof(server.sin_zero));

	netdbg_sock = sceNetSocket("netdebug", AF_INET, SOCK_STREAM, 0);
	sceNetConnect(netdbg_sock, (struct sockaddr *)&server, sizeof(server));


	ftp_init(PS4_IP, PS4_PORT);

	//INFO("PS4 listening on IP %s Port %i\n", PS4_IP, PS4_PORT);

	while (1) {
		sceKernelUsleep(100 * 1000);
	}

	ftp_fini();

	return 0;
}
Example #2
0
File: server.c Project: mannias/SO
int main() {
	int fd;
	Message* data;
	head = tail = NULL;
	mailhead = mailtail = NULL;
	users = createList(NULL);
	initUserList("csv/users.csv", users);
	createConnection(0);
	signal(SIGINT, dumpAll);

    initPthread();

	while(1){
		// fd = acceptConnection(0);
		// data = (Message*)listenMessage(fd, sizeof(Message));
		// if(data != NULL){
		// 	if(strcmp(data->resource, "client") == 0){
		// 		if(strcmp(data->method, "register") == 0){
		// 			registerClient(data->referer, fd);
		// 			cloneConnection(data);
		// 		}else{
		// 			printf("Error on basic connection to server 2\n");
		// 		}
		// 	}else{
		// 		printf("Error on basic connection to server 1\n");
		// 	}

		// }
	}
	// closeConnection(0);
	return 1;
}
Example #3
0
int _main(void) {
    // Init and resolve libraries
    initLibc();
    initPthread();

    int foo = 0;

    ScePthread thread;
    scePthreadCreate(&thread, NULL, thread_func, (void *)&foo, "pthread_sample");

    // Wait until the thread terminates
    scePthreadJoin(thread, NULL);

    return foo;
}