예제 #1
0
파일: main.c 프로젝트: cfwprpht/FTPS4
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;
}
예제 #2
0
파일: server.c 프로젝트: 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;
}
예제 #3
0
파일: main.c 프로젝트: psxdev/PS4-SDK
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;
}