Author Topic: Start server on the second time fail  (Read 1697 times)

dereklam0528

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 20
    • View Profile
Start server on the second time fail
« on: July 24, 2014, 10:24:18 AM »
Please forgive me that I have very limited knowledge on network stuff, and here I might asking a very silly question. Please forgive me.

I always have an issue with starting a server again after I disconnect the previous connection. So here is the flow:

1. Start server by doing TNServerInstance.Start(5127, 0, null, 5129);
2. Play a game with another iPad via LAN connection
3. Leave Channel after finish
4. Disconnect on leave channel
5. Start server by doing TNServerInstance.Start(5127, 0, null, 5129); again
6. Crash

Is it because I am using the same port again or the server is still active so it crashes after I use the same port or something?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Start server on the second time fail
« Reply #1 on: July 25, 2014, 12:48:58 AM »
Why are you starting a server the 2nd time? Your server is still active. Disconnecting from a server doesn't shut it down. You need to TNServerInstance.Stop it first.

dereklam0528

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 20
    • View Profile
Re: Start server on the second time fail
« Reply #2 on: July 25, 2014, 01:27:17 AM »
Oh, right. Sorry my bad. I thought the server no longer active when disconnect.  :-\