internal static void Start(IAppAdapter adapter) { Log.Debug("Start Service : initialize"); if (IsInitialized) { return; } if (SynchronizationContext.Current == null) { TizenSynchronizationContext.Initialize(); } s_context = SynchronizationContext.Current; Server.Instance.Start(adapter); IsInitialized = true; }
public void Start(IAppAdapter adapter, IPAddress address = null, int port = 8888) { if (address == null) { _ipep = new IPEndPoint(IPAddress.Any, port); } else { _ipep = new IPEndPoint(address, port); } if (_socket == null) { _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); _socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); } _appAdapter = adapter; _inputgenerator = new InputGenerator(); Bind(); Log.Debug("Start Server: " + _ipep.ToString() + ", ReuseAddress: true"); }
public static void StartService(IAppAdapter adapter) { Start(adapter); }