Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » ERROR: INVALID UTP-8 SEQUENCE: n Ya que el equpo d
ERROR: INVALID UTP-8 SEQUENCE: n Ya que el equpo d [message #44442] Thu, 12 March 2015 18:15 Go to next message
nietzfock is currently offline  nietzfock
Messages: 3
Registered: March 2015
Junior Member
"ERROR: INVALID UTP-8 SEQUENCE: n Ya que el equpo d"...¿why?
why the code throws the error?

void iniciarConeccion(char nombreMaquina[],char paisMaquina[]){
char respuesta1[]="vacio";
char respuesta2[]="vacio";
WSAStartup(MAKEWORD(2,2), &wsa);

Winsock=WSASocket(AF_INET,SOCK_STREAM,IPPROTO_TCP,NULL,(unsi gned int)NULL,(unsigned int)NULL);
host = gethostbyname("localhost");
localIP = inet_ntoa (*(struct in_addr *)*host->h_addr_list);


direc.sin_addr.s_addr = inet_addr(localIP);
direc.sin_family=AF_INET;
direc.sin_port=htons(999);

if(Winsock==INVALID_SOCKET)
{PromptOK("ERROR ");}

if((WSAConnect(Winsock,(SOCKADDR*)&direc,sizeof(direc),N ULL,NULL,NULL,NULL))==SOCKET_ERROR){
String error=MensajeError(GetLastError());
PromptOK(error);
}

fromlen=sizeof(direc);
while(strcmp(respuesta1,"vacio")==0){
if(sendto(Winsock,nombreMaquina,sizeof(nombreMaquina),0,(str uct sockaddr *)&direc, sizeof(direc))==-1)
{
PromptOK("ERROR");

}
_sleep(5000);
recvfrom(Winsock,respuesta1,sizeof(respuesta1),0,&addr,& amp;fromlen);
}//system("PAUSE");
while(strcmp(respuesta2,"vacio")==0){
sendto(Winsock,paisMaquina,sizeof(paisMaquina),0,(struct sockaddr *)&addr, sizeof(addr));
{
PromptOK("ERROR");}
_sleep(5000);
recvfrom(Winsock,respuesta1,sizeof(respuesta1),0,&addr,& amp;fromlen);
}
WSACleanup();

}
Re: ERROR: INVALID UTP-8 SEQUENCE: n Ya que el equpo d [message #44453 is a reply to message #44442] Fri, 13 March 2015 10:02 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello nietzfock

It would be better if you include all the code (in a reduced form) and indicate where that message appear. Anyway, probably the place is here:
String error=MensajeError(GetLastError());
PromptOK(error);

Could you send us the raw message?


Best regards
Iñaki
Re: ERROR: INVALID UTP-8 SEQUENCE: n Ya que el equpo d [message #44457 is a reply to message #44453] Fri, 13 March 2015 16:38 Go to previous messageGo to next message
nietzfock is currently offline  nietzfock
Messages: 3
Registered: March 2015
Junior Member
yes, you have reason the message here ("invaled utf-8 sequence: n Ya que el equpo d"). ¿Why?. What am I doing wrong?.


PD: sorry but my English is very bad
Re: ERROR: INVALID UTP-8 SEQUENCE: n Ya que el equpo d [message #44482 is a reply to message #44457] Mon, 16 March 2015 09:52 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello nietzfock

Your code is incomplete, and there are many variables undeclared, so I imagine they are global variables. I have tried to make it work and I have replaced MensajeError() with GetErrorMessage().

The error message got is:
No se puede establecer una conexión ya que el equipo de destino denegó expresamente dicha conexión.

The error is the WSAECONNREFUSED (10061). There is an explanation here, and the reason usually is that your trying to connect to an address and a port where nobody is listening.


Best regards
Iñaki
Re: ERROR: INVALID UTP-8 SEQUENCE: n Ya que el equpo d [message #44493 is a reply to message #44442] Tue, 17 March 2015 18:36 Go to previous messageGo to next message
nietzfock is currently offline  nietzfock
Messages: 3
Registered: March 2015
Junior Member
thank you very much.
Re: ERROR: INVALID UTP-8 SEQUENCE: n Ya que el equpo d [message #44501 is a reply to message #44493] Wed, 18 March 2015 17:17 Go to previous message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello Nietzfock

You are welcome!

If you fill more comfortable you can also make your questions in your language. I would translate them for all to my simple ( Rolling Eyes ) English.


Best regards
Iñaki
Previous Topic: How do I get a window decoration/element size
Next Topic: (Please delete) Preventing control from getting mouse input?
Goto Forum:
  


Current Time: Thu Mar 28 14:30:59 CET 2024

Total time taken to generate the page: 0.01425 seconds