(!)UPDATE: Note: The developing on this project is now suspended , i don’t know for how much time,it can take forever or i will be back anyway when i will take my grade.
Social Network(College Project)
Hi, I’m Hoenir.For those who wonder i’m not the norse god Hoenir, but i wished that i was. It’s just an alias that i carry on.I’m a computer science student,who in his time creates different projects.In this projects it’s all about creating a social network implemented with sockets, making an concurrent server.Feel free to test my project, note that the project comes with ipv4 version compatibility , it does not support yet ipv6 , i hope if it goes well i will support it but for now it’s ok with ipv4.The application will include different features like login,register,chat with different friends on the group,add your own profile detail and more. The project will be written in C and i hope i include a command interface with bash in the final state of the project. Note that the project it’s on course of developing so isn’t finished yet.In the project i used an integrated api for C in the libmysqlclient-dev (library).This library pack includes all the mysql functions, mysql variables i used in my applications.
If you want to run and test it for yourself you must follow these instructions: (Note: It has bugs and it’s still development)
1)To be able to compile the program, we need to install the MySQL C development libraries. The above line how we can do it on Debian based Linux.
sudo apt-get install libmysqlclient-dev
2) To be able to run the application as localhost you need to install mysql-client to connect and manage your database and mysql-server to host it.
sudo apt-get install mysql-client
sudo apt-get install mysql-server
3)After the step “2)” now,we must configure our database, to do so run:
mysql -u root -p
After “enter” you need to type your password that you added when you installed the mysql-server
4)After you succed to log in as “root” now you must create a database named as “VirtualSoc” and also a client with the same name and with password “socket123” and specific rights.
CREATE DATABASE VirtualSoc;
CREATE USER 'VirtualSoc'@'localhost' IDENTIFIED BY 'socket123';
CREATE USER 'VirtualSoc'@'127.0.0.1' IDENTIFIED BY 'socket123';
5)Now we will add privileges
GRANT ALL ON VirtualSoc.* TO 'VirtualSoc'@'localhost';
GRANT ALL ON VirtualSoc.* To 'VirtualSoc'@'127.0.0.1';
6)Now after we created the username and his privileges we need to refresh the system;
7)Now we have created the database and the user to connect and execute querys.Note that we are still logged as root.(!)To verify that all is working good execute the next command:
Select Host,User,Password from mysql.user;
(If you see two users VirtualSoc with host 127.0.0.1 and localhost it’s ok).
8)Now the last thing you must do is to execute the script to create all the tables.Don’t panic the script is included in the same file with the program.Just type in the command line above correctly using the example.
Note: If you have different name of you username on linux or you downloaded some else where just specific here the path:
(!) You must have /VirtualSoc/mysql_scripts_create_table.sql or it will don’t work.
9)To compile the application you need to run these commands.
10)To run the application you need to run these commands in different windows/terminals
./VirtualSocExe 127.0.0.1 5432