This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* UDP echo server program -- udp-echo-server.c */ | |
#include <stdio.h> /* standard C i/o facilities */ | |
#include <stdlib.h> /* needed for atoi() */ | |
#include <sys/types.h> /* system data type definitions */ | |
#if defined(_WIN32) | |
#include <WinSock2.h> | |
#pragma comment(lib, "Ws2_32.lib") | |
#else | |
#include <unistd.h> /* defines STDIN_FILENO, system calls,etc */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* udp-client.c - A simple UDP client | |
* usage: udp-client <host> <port> | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#if defined(_WIN32) | |
#include <WinSock2.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; | |
; Definition file for the DLL version of the crypto library from mbedTLS | |
; | |
; LIBRARY mbedTLS | |
EXPORTS | |
mbedtls_aes_init | |
mbedtls_aes_free |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdbool.h> | |
unsigned int get_digit_value(char digit) { | |
int n = digit - '0'; | |
if (n >= 0 && n<10) { return (unsigned int) n; } | |
if ((digit == 'A') || (digit == 'a')) { return 10; } | |
if ((digit == 'B') || (digit == 'b')) { return 11; } | |
if ((digit == 'C') || (digit == 'c')) { return 12; } | |
if ((digit == 'D') || (digit == 'd')) { return 13; } | |
if ((digit == 'E') || (digit == 'e')) { return 14; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#if defined(_WIN32) | |
#include <WinSock2.h> | |
#include <ws2tcpip.h> | |
#pragma comment(lib, "Ws2_32.lib") | |
#else | |
#include <arpa/inet.h> | |
#include <netinet/in.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#if defined(_WIN32) | |
#include <WinSock2.h> | |
#include <ws2tcpip.h> | |
#pragma comment(lib, "Ws2_32.lib") | |
#else | |
#include <arpa/inet.h> | |
#include <netinet/in.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <uv.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
void uv_alloc_buffer(uv_handle_t *handle, size_t size, uv_buf_t *buf); | |
void uv_free_buffer(uv_buf_t *buf); | |
void client_accept_cb(uv_stream_t *server, int status); | |
void client_read_done_cb(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf); | |
void client_close_done_cb(uv_handle_t* handle); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# https://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000/001432004374523e495f640612f4b08975398796939ec3c000#0 | |
import socket, threading, time | |
#TCP socket based on ipv4 | |
#server | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
#listening on port |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding:utf-8 -*- | |
import socket | |
#client | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
#establish connection | |
s.connect(('35.199.116.57', 9999)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <http_parser.h> | |
#include <inttypes.h> | |
#include <ctype.h> | |
#include <mbedtls/sha1.h> |
OlderNewer