Skip to main content
gamedev.net
🔒 Locked

xmlsocket + winsock

Started by lampik 0 replies 450+ views
Original Post
lampik
lampik
hello, i have problem with receiving data with my flash client from my server written in c++ i know that string which is sended to flash client has to be ended by null character, but it doesn't work for me :( here is my function for sending data via winsock


int swriteln(int Socket, char *Msg, ...)
{
  char WTmp1[1024] = {0};
  char WTmp2[1024] = {0};
  va_list VList;
  FILE *fw;
  
  if (strlen(Msg) < 1024) {
  
    va_start(VList, Msg);						
      vsprintf(WTmp1, Msg, VList);
    va_end(VList);
	
    sprintf(WTmp2, "%s%c", WTmp1, '\0');
	
    int size;
    if ((size = send(Socket, WTmp2, strlen(WTmp2), 0)) != 0) return 0;
	
    return 1;
  }
}





can anybody help me with form of outgoing strings? i am sure that flash client received this string but it doesn't recognize the null character... thx 4 help [Edited by - lampik on January 17, 2005 10:25:36 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.