Skip to content
Snippets Groups Projects
Commit 40160077 authored by Leonardo's avatar Leonardo
Browse files

Mayusculas y comparaciones

parent 6006d251
No related branches found
No related tags found
No related merge requests found
......@@ -20,9 +20,9 @@
using namespace cv;
/** CONSTANTES Y CONFIGURACION **/
const char delimiter[] = "Grupo25";
const int keepAliveIntervalSeconds = 30;
const int keepAliveIntervalSeconds = 5;
const bool debug = false;
// DEFINICION DE FUNCIONES
......@@ -183,7 +183,7 @@ void UDP(char* HOSTNAME){
char buffer[256];
bzero(buffer,256);
sprintf(buffer, "subscription");
sprintf(buffer, "SUBSCRIPTION");
// ENVIO PEDIDO DE SUSCRIPCION
printf("Enviando Suscripcion a %s:%d ...\n", HOSTNAME, UDP_PORT); ::fflush(stdout);
......@@ -306,14 +306,24 @@ const char* getIP(char* hostname){
return ipAddress;
}
char* upCase(char* arg){
char* s = arg;
unsigned char c;
while(*s){
c = *s;
*s = toupper(c);
s++;
}
return arg;
}
int main(int argc, char *argv[]) {
// Register signals
signal(SIGINT, my_function);
if (strcmp(argv[1],"TCP") == 0){
if (strcmp(upCase(argv[1]),"TCP") == 0){
TCP(argv[2]);
}else if (strcmp(argv[1],"UDP") == 0){
}else if (strcmp(upCase(argv[1]),"UDP") == 0){
UDP(argv[2]);
}else{
printf("ERROR: primer argumento debe ser TCP o UDP.\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment