• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by matrix211v1 · Aug 10, 2017 at 02:16 PM · unity 5networkingscript.crashserver

Unity3d Apache Thrift Server

Hello!

I am using Apache Thrift to have Unity act as a Thrift Server. When I try to do that, once it calls the "server.Serve()" it locks up Unity.

Here is the code:

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using Thrift.Server;
 using Thrift.Transport;
 using System;
 
 public class CSharpServer : MonoBehaviour
 {
 
     // Use this for initialization
     void Start()
     {
         Application.runInBackground = true;
 
         try
         {
             CSharpTutorial.CalculatorHandler handler = new CSharpTutorial.CalculatorHandler();
             Calculator.Processor processor = new Calculator.Processor(handler);
             TServerTransport serverTransport = new TServerSocket(9090);
             TServer server = new TSimpleServer(processor, serverTransport);
 
             // Use this for a multithreaded server
             //TServer server = new TThreadPoolServer(processor, serverTransport);
 
             Debug.Log("Starting the server...");
             server.Serve(); // <-- This is the line that causes the lockup.
         }
         catch (Exception x)
         {
             Debug.Log(x.StackTrace);
         }
         Debug.Log("done.");
     }
 
 }

Having Unity work as a Client works just fine. It can call a Server written in any language with no issues. All the examples I can find only show Unity as a Client and not as a server.

The purpose of this is due to that I need two way communication using Thrift. Therefore the client can call the server and the server can call the client.

I can just have the client Poll the Server every x seconds to get see if there are any messages but I'm trying this method first.

I am trying this on both Unity 5.6.1 and Unity 2017.1 Using Thrift 0.10.0 Windows Stand Alone Build

I have already Googled "unity3d thrift server" and went through the first 20 pages and all their links with no result ( the ones that do really talk about it are set for Unity as a client )

Thanks for any and all help.

Comment

People who like this

0 Show 0
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image

Answer by faev999 · Sep 18, 2017 at 04:09 PM

Hi

matrix211v1

, did you find a solution for this

Comment

People who like this

0 Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image matrix211v1 · Sep 18, 2017 at 04:10 PM 0
Share

No I did not.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

167 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity networking tutorial? 6 Answers

Linux Headless Server on Unity 5 - Idle CPU Load 1 Answer

Unity Game server crashing with 0 Players 1 Answer

(PUN) How to set up local player's position and other player's positions at a fixed transform.position? 0 Answers

Unable to start Unity Server for receiving Kinect input to android device 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges