Skip to content
View sFinOe's full-sized avatar
🎯
Focusing
🎯
Focusing

Highlights

  • Pro

Block or report sFinOe

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
sFinOe/README.md

Hi πŸ‘‹, I'm Zakaria Kasmi

#include <about_me>

using namespace std

int main() {
    std::cout << "Launching New HTTP Connection!!!" << std::endl;

    int serverSocket = socket(AF_INET, SOCK_STREAM, 0);
    if (serverSocket < 0)
        _error(errno);

    int optval = 1;
    if (setsockopt(serverSocket, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)) < 0)
        _error(errno);

    sockaddr_in serverAddress;
    serverAddress.sin_family = AF_INET;
    serverAddress.sin_addr.s_addr = inet_addr("127.0.0.1");
    serverAddress.sin_port = htons(3000);
    memset(&(serverAddress.sin_zero), '\0', 8);

    if (bind(serverSocket, reinterpret_cast<sockaddr*>(&serverAddress), sizeof(serverAddress)) < 0)
        _error(errno);

    if (listen(serverSocket, SOMAXCONN) < 0)
        _error(errno);

    std::cout << "Waiting For Connection!!!" << std::endl;

    sockaddr_in clientAddress;
    socklen_t clientAddressSize = sizeof(clientAddress);
    int clientSocket = accept(serverSocket, reinterpret_cast<sockaddr*>(&clientAddress), &clientAddressSize);
    if (clientSocket < 0)
        _error(errno);

    send(clientSocket, "Welcome To My Profile <3", 26, 0);

    std::cout << "Thanks For Visiting My Profile" << std::endl;

    close(clientSocket);
    close(serverSocket);

    return 0;
}

zakie_kasmi

Blogs posts

Connect with me:

sfinoe zakie_kasmi sfinoe sfinoe zakisblue

Languages and Tools:

Android C C++ JavaScript React React Native NodeJS Express.js

Anurag's GitHub stats

Anurag's GitHub stats

GitHub Streak

Popular repositories Loading

  1. Custom-C-Library Custom-C-Library Public

    C 2

  2. sFinOe sFinOe Public

    2

  3. 3D-Game 3D-Game Public

    C 2

  4. Bash-From-Scratch Bash-From-Scratch Public

    C 2

  5. dining-philo-problem dining-philo-problem Public

    C 2

  6. Push-To-Stack Push-To-Stack Public

    C 2