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
/* | |
https://stackoverflow.com/questions/11990700/broken-pipe-epipe-on-connection-to-loopback-address/12068942#12068942 | |
*/ | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
/* Required by event.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> | |
void aux_func(int n, char * buf, int radix, int i, int *len) { | |
int q = n / radix; | |
int r = n % radix; | |
if (q < radix && q >=0 ) { | |
*len = i + 2; | |
*(buf+1) = r + '0'; |
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
import java.io.InputStreamReader; | |
import java.io.PrintWriter; | |
import java.io.BufferedReader; | |
import java.net.Socket; | |
import java.net.ServerSocket; | |
import java.util.List; | |
import java.util.LinkedList; |