0
\$\begingroup\$

I have a unity3d Player where I need some data from the server. The server code is written in python while on client side is C#.

Now I am searching a way that server directly post/push data to my unity player. IMO! it is not possible to push data to unity player without requesting the server using WWW class. My question is can python post data to my client unity player? with something like

response = requests.post(client_url, data = request_data, headers = headers)

I want to do this because i want to avoid repetitive calls to server which is not an efficient way.

\$\endgroup\$
3
  • \$\begingroup\$ Generally speaking, a game client doesn't have a client_url for your Python server to ping. It's possible to structure your app so that it's essentially a server, but you'll generally run into problems (even at the NAT/Firewall level). That architecture can also put a lot of the work (managing lists of clients to contact, making calls which may never get answered, etc.) on the server side, which is normally not what you want. Have you looked into the techniques mentioned in the answer of the article you linked? They're some common ways of making clients request "future" updates. \$\endgroup\$
    – A C
    Commented Oct 17, 2017 at 20:40
  • \$\begingroup\$ Thanks for input. You are right getting client url is not easy as their are NAT also involve. what else should i do \$\endgroup\$ Commented Oct 18, 2017 at 4:49
  • \$\begingroup\$ The answer given in link is not also acceptable (maybe long polling is acceptable). websocket are browser based and unity networking is not feasible as i can't use unity it on server. \$\endgroup\$ Commented Oct 18, 2017 at 4:52

0

You must log in to answer this question.

Browse other questions tagged .