Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: passing SocketTCP to thread problem  (Read 3543 times)

0 Members and 1 Guest are viewing this topic.

Farkraj

  • Newbie
  • *
  • Posts: 5
    • View Profile
passing SocketTCP to thread problem
« on: December 24, 2011, 11:59:34 am »
Hi! I want to pass the SocketTCP to my thread function but compiler says its private :/ i have to create listening thread so i need it.
Code: [Select]

void Client_Listen_Thread(void* UserData)
{
  sf::SocketTCP Server = static_cast<sf::SocketTCP>(UserData);
  [...] blabla


and
Code: [Select]

sf::Thread ListenThread(&Client_Listen_Thread,&Server);


Help please :(

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
passing SocketTCP to thread problem
« Reply #1 on: December 24, 2011, 12:13:12 pm »
Code: [Select]
sf::SocketTCP* Server = static_cast<sf::SocketTCP*>(UserData);
Laurent Gomila - SFML developer

Farkraj

  • Newbie
  • *
  • Posts: 5
    • View Profile
passing SocketTCP to thread problem
« Reply #2 on: December 24, 2011, 12:51:31 pm »
Thanks ;p iam so stupid i forgot this

 

anything