locked
Creating multiplayer Windows Store application.

    Question

  • Hi!

    I create mutliplayer game for "big and small" Windows and decided to use socket thought TCP to transfer data in my application. My problem is in creating server, that can be found by the other clients. How can I do it?

    Sunday, March 29, 2015 11:24 PM

Answers

  • Hi MiXenXd,

    The DatagramSocket itself is a UDP datagram socket. StreamSocket class is over TCP socket, see How to connect with a stream socket for more information. 

    As you can see in the DatagramSocket methods, it can bind to a local service as a listener but streamSocket cannot do the same thing, perhaps we should discover the game server by UDP and talk to it by TCP

    --James

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, April 14, 2015 1:32 AM
    Moderator
  • I want to use TCP connection beetween devices, not UDP and this tutorial is for UDP connection. Can you give me some advices for TCP connections?

    Use UDP for discovering your application instances and then establish a connection with TCP/IP. That's a common pattern.
    Monday, April 20, 2015 12:52 AM

All replies

  • Hi MiXenXd,

    Listen to some socket and wait for the message come? DatagramSocket.BindServiceNameAsync | bindServiceNameAsync method

    But you also need to consider about App lifecycle, for instance if the app is suspend, you cannot listen to the port anymore.

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, March 30, 2015 7:01 AM
    Moderator
  • I want to use TCP connection beetween devices, not UDP and this tutorial is for UDP connection. Can you give me some advices for TCP connections?
    Monday, March 30, 2015 2:43 PM
  • Hi MiXenXd,

    The DatagramSocket itself is a UDP datagram socket. StreamSocket class is over TCP socket, see How to connect with a stream socket for more information. 

    As you can see in the DatagramSocket methods, it can bind to a local service as a listener but streamSocket cannot do the same thing, perhaps we should discover the game server by UDP and talk to it by TCP

    --James

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, April 14, 2015 1:32 AM
    Moderator
  • I want to use TCP connection beetween devices, not UDP and this tutorial is for UDP connection. Can you give me some advices for TCP connections?

    Use UDP for discovering your application instances and then establish a connection with TCP/IP. That's a common pattern.
    Monday, April 20, 2015 12:52 AM