R
R
Roman2015-10-25 21:40:25
Unity
Roman, 2015-10-25 21:40:25

How to connect c# client to java server?

Hello.
I have such a problem, I can not connect a server written in java with a client in another language (c#). I'm making a game in Unity3D.
Script:
using UnityEngine;
using System.Collections;
public class Player : MonoBehaviour {
// Use this for initialization
void Start () {
Network.Connect("192.168.0.100", 6666);
}
// Update is called once per frame
void Update () {
}
}
/////////////////////////////////
Server console :
Server: waiting for client at: Roman/192.168.0.100: 6666
...
/////////////////////////////////////////////////////////
writing in Unity3D?
The connection request to 192.168.0.100:6666 failed. Are you sure the server can be connected to?

//////////////////////////
Since I only understand all this, I often stumble over stones.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mark Doe, 2015-10-25
@Garry_Potter

Network.Connect, as far as I know, is only used to connect to a Unity.Network server (which listens on a port after calling Network.InitializeServer in Unity) - and your Java server is obviously using the wrong protocol. I would like to take a look at your java server code

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question