/// <summary> /// Default constructor. /// </summary> /// <param name="stack">Owner SIP stack.</param> /// <exception cref="ArgumentNullException">Is raised when <b>stack</b> is null reference.</exception> internal SIP_TransportLayer(SIP_Stack stack) { if(stack == null){ throw new ArgumentNullException("stack"); } m_pStack = stack; m_pUdpServer = new UDP_Server(); m_pUdpServer.ProcessMode = UDP_ProcessMode.Parallel; m_pUdpServer.PacketReceived += new PacketReceivedHandler(m_pUdpServer_PacketReceived); m_pUdpServer.Error += new ErrorEventHandler(m_pUdpServer_Error); m_pTcpServer = new TCP_Server<TCP_ServerSession>(); m_pTcpServer.SessionCreated += new EventHandler<TCP_ServerSessionEventArgs<TCP_ServerSession>>(m_pTcpServer_SessionCreated); m_pFlowManager = new SIP_FlowManager(this); m_pBinds = new IPBindInfo[]{}; m_pRandom = new Random(); m_pLocalIPv4 = new CircleCollection<IPAddress>(); m_pLocalIPv6 = new CircleCollection<IPAddress>(); }
// Use this for initialization void Start() { server = this.GetComponent <TCP_Server>(); GameObject locator = GameObject.Find("Manus_VR_Driver"); interpreter = locator.GetComponent <Manus_interpreter>(); }
private void Stop_Click(object sender, RoutedEventArgs e) { try { Server.Stop(); Server = null; } catch { } }
public void Host(int tcpport = 27015, int udpport = 27016) { counter = 1; connections.Clear(); // udppeer = new PacketPeerUDP(); // udppeer.Listen(udpport); tcpserver = new TCP_Server(); tcpserver.Listen(tcpport); }
// send position of found object/ball via tcp static void FoundIt(float x, float y, int width, int height) { float x01 = (float)x / (float)width; float y01 = (float)y / (float)height; //Console.WriteLine("> X " + x01 + " Y " + y01); TCP_Server.SendPosition(x01, y01); }
// Use this for initialization void Start() { server = GetComponent <TCP_Server>(); selected_robot = "None"; change_robot = false; old_time = Time.time; image.GetComponent <Image>().color = new Color32(255, 0, 0, 100); output_text.text = selected_robot; }
// Use this for initialization void Start() { server = GetComponent <TCP_Server>(); GameObject gripper = GameObject.Find("Base_Gripper"); grip_obj = gripper.GetComponent <gripper_kinematic>(); //GameObject robot = GameObject.Find("UR5"); angle_controller = robot.GetComponent <ur5_kinematics>(); }
public void OnStart() { _Desktop_Service = new Desktop_Service(); _Desktop_Service.ScreenUpdateEvent += _Desktop_Service_ScreenUpdateEvent; _Desktop_Service.MouseImageChangedEvent += _Desktop_Service_MouseImageChangedEvent; _Desktop_Service.MousePositionChangedEvent += _Desktop_Service_MousePositionChangedEvent; _Server = new TCP_Server(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) + "\\privatekey.xml", 443); _Server.ReceiveEvent += _server_ReceiveEvent; _Server.NewClientEvent += _Server_NewClientEvent; _Server.DisconnectEvent += _Server_DisconnectEvent; RunNetwork(); }
/// <summary> /// 构造 /// </summary> /// <param name="hostName"></param> /// <param name="ip"></param> /// <param name="port"></param> /// <param name="delegate_ReceiveHandler"></param> public Server(string hostName, string ip, int port, ReceiveHandler delegate_ReceiveHandler) { HostName = hostName; IP = ip; Port = port; Delegate_ReceiveHandler = delegate_ReceiveHandler; tcpServer = new TCP_Server <TCP_ServerSession>(); tcpServer.Bindings = new LumiSoft.Net.IPBindInfo[] { new IPBindInfo(HostName, LumiSoft.Net.BindInfoProtocol.TCP, System.Net.IPAddress.Parse(IP), Port) }; tcpServer.SessionCreated += new EventHandler <TCP_ServerSessionEventArgs <TCP_ServerSession> >(tcpServer_SessionCreated); }
public void CloseHost() { foreach (var conn in connections) { conn.Value.DisconnectFromHost(); } tcpserver.Stop(); udppeer.Close(); udppeer = null; tcpserver = null; connections.Clear(); }
/// <summary> /// Todo /// Determine best approach to leading the data from the digital out port to the output string. /// </summary> // Use this for initialization void Start() { server = GetComponent <TCP_Server>(); GameObject gripper = GameObject.Find("Base_Gripper"); //tcp_scan = GetComponent<TCP_scanner_and_selector_19>(); grip_obj = gripper.GetComponent <gripper_kinematic>(); output_string = ""; chgner = GetComponent <Change_robots>(); //GameObject robot = GameObject.Find("UR5"); angle_controller = robot.GetComponent <ur5_kinematics>(); send_msg.onClick.AddListener(add_active_state); }
static void Main(string[] args) { Console.WriteLine("Introduzca el puerto FTP"); int puerto = int.Parse(Console.ReadLine()); using (FtpServer server = new FtpServer(IPAddress.Any, puerto)) { Chord.ChordStart(); using (TCP_Server serverTCP = new TCP_Server(IPAddress.Any, Chord.port + 1)) { serverTCP.Start(); server.Start(); Console.WriteLine("Press any key to stop..."); Console.ReadKey(true); } } }
static void Main(string[] args) { const int port = 1111; System.Console.WriteLine("SMT_MacroPlacer: Heuristics Lab Fronend"); System.Console.WriteLine("Handle Placement Problems transmitted by TCP/IP"); System.Console.WriteLine(""); System.Console.WriteLine("Copyright: Johannes Kepler University Linz"); System.Console.WriteLine("Author : Pointner Sebastian"); System.Console.WriteLine("Version : 0.1"); System.Console.WriteLine(""); TCP_Server server = new TCP_Server(port); server.handle_requests(); System.Console.WriteLine(""); System.Console.WriteLine(""); System.Console.WriteLine("Heuristics Lab Fronend Terminating"); }
static void Main(string[] args) { _fpsStopWatch = new Stopwatch(); // load and apply config ApplyConfig(LoadConfig()); TCP_Server.InitServer(); using (CvCapture cap = CvCapture.FromCamera(1)) { //using (CvWindow winBin = new CvWindow("Camera Binary")) using (CvWindow winSrc = new CvWindow("Camera Source")) { switch (mode) { case Mode.Tracking: Calibration(cap, winSrc); if (trackingType == TrackingType.Blob) { FindBlob(cap, winSrc); } else { CircleOnly(cap, winSrc); } break; case Mode.Live: Live(cap, winSrc); break; case Mode.Calibration: Calibration(cap, winSrc); break; } } } TCP_Server.CloseAll(); }
private void Start_Click(object sender, RoutedEventArgs e) { try { ClientList = null; Server.Stop(); Server = null; } catch { } try { ClientList = new ObservableCollection <TCP_ClientNode>(); Clients.ItemsSource = ClientList; Server = new TCP_Server(IPAddress.Any, cmdhand, 25444); try { Server.SSL_Cert = X509Certificate.CreateFromCertFile(AssemblyDirectory + "/Cert.cer"); } catch { MessageBox.Show("Server Has No Certificate"); } Server.MaxConnections = 10; Server.TCP_ClientState_Changed += Server_TCP_ClientState_Changed; Server.TCP_AcceptClients_Changed += new TCP_AcceptClients_Handeler((s) => AcceptConnection.IsChecked = s); Server.TCP_Data_Event += new TCP_Data((s, c, d) => { Action act = new Action(() => MessageBox.Show("Data Recv\n\nClient ID: " + c.ID + "\nData Direction: " + d.ToString() + "\nData: " + s)); act.Invoke(); }); Server.Start(); } catch (Exception ex) { MessageBox.Show("Failed to Start\n\n" + ex.ToString()); } }
static void Main(string[] args) { AppDomain currentDomain = AppDomain.CurrentDomain; currentDomain.UnhandledException += new UnhandledExceptionEventHandler(UnhandledExceptionHandler); // Console.CancelKeyPress += new ConsoleCancelEventHandler(ConsoleCancelHandler); //Console.WriteLine(args[0]); if (readXMLdocument() == 0) { if (args.Length > 0) { foreach (string arg in args) { if (arg == "-req:start") { progSettings.start = true; } } } if ((progSettings.TCPport >= 0) && progSettings.start) { try { //logger.Debug("Попытка соединия соединия БД MySQL"); Sqlhandler_.ConnectOpen(); Sqlhandler_.ConnectClose(); logger.Debug("Попытка соединия соединия БД MySQL - Успешно"); MeterQuerier = new Task(loopMeterQuerier); MeterQuerier.Start(); refreshTimer = new System.Timers.Timer(30000); refreshTimer.AutoReset = false; refreshTimer.Elapsed += new System.Timers.ElapsedEventHandler(refreshTimer_Elapsed); refreshTimer.Enabled = true; logger.Debug("Старт опроса"); Console.Beep(1000, 500); server = new TCP_Server(answerMakerMetod); server.Start(progSettings.TCPport); logger.Debug("Запуск TCP севера. Порт: {0}", progSettings.TCPport); } catch (Exception ex) { logger.Error("{0}: {1}", ex.Source, ex.Message); Console.ReadLine(); return; } } } while (b_work) { if (Console.ReadLine() == "exit") { break; } } }
/// <summary> /// Cleans up any resources being used. /// </summary> internal void Dispose() { if(m_IsDisposed){ return; } m_IsDisposed = true; Stop(); m_IsRunning = false; m_pBinds = null; m_pRandom = null; m_pTcpServer.Dispose(); m_pTcpServer = null; m_pUdpServer.Dispose(); m_pUdpServer = null; }
}; //The following string list are the supported robots. // Use this for initialization void Start() { server = GetComponent <TCP_Server>(); selected_robot = "None"; old_time = Time.time; }
public void start_server() { server = new TCP_Server<TCP_ServerSession>(); server.SessionCreated += server_SessionCreated; IPBindInfo x = new IPBindInfo("server", BindInfoProtocol.TCP, System.Net.IPAddress.Any, 8787); server.Bindings = new IPBindInfo[] { x }; server.Start(); Log.log_info("TCP Server Started"); }
// Use this for initialization void Start() { TCP_Server.server(); image = GameObject.Find("Hands/Twohands Canvas/Image").GetComponent <Image>(); //唤起菜单的进度条 imageL = GameObject.Find("Hands/Twohands Canvas/Image2").GetComponent <Image>(); //左手观察商品的进度条,在左手上,需要修改,暂时用这个 }