public MyDataComunication OpenCommunication(string ipAddress, Action <object> callbackDataForImageProcessing) { ImageServer = new MyTcpServer(NetworkConstants.LocalLisenerConnection, 27001); ImageClient = new MyTcpClient(ipAddress, 27001); VoiceClient = new MyUdpClient(ipAddress, 27000); VoiceServer = new MyUdpServer(NetworkConstants.LocalLisenerConnection, 27000); ReciveImageAndProcess(callbackDataForImageProcessing); GrabImageAndSend(); RecordSoundAndSend(); ReceiveAndPlaySound(); return(this); }
/// <summary> /// Starts to listen on a UDP port. /// </summary> /// <param name="listenAddress">The address to listen to.</param> /// <returns>True, if startup was successful.</returns> private bool StartupUdp(IPEndPoint listenAddress) { try { var pipeline = GetPipeline(false); _udpServer = new MyUdpServer(listenAddress, pipeline); // rest of config done in MyUdpServer _udpServer.Start(); return(true); } catch (Exception ex) { Logger.Error("An exception occured when starting up UDP server.", ex); return(false); } }
public void Start(ServerDatas gameServerDatas, ServerDatas mmServerDatas, Func <Match, ServerGameMaster> createGameMaster, bool debug = false) { this.debug = debug; Server = new MyUdpServer(); string udpAddress = CliArguments.GetArgument("--address"); string udpPort = CliArguments.GetArgument("--port"); Server.Start(udpAddress != null ? udpAddress : gameServerDatas.address, udpPort != null ? int.Parse(udpPort) : gameServerDatas.port, debug); Client = new MyTcpClient(); string mmAddress = CliArguments.GetArgument("--mmaddress"); string mmPort = CliArguments.GetArgument("--mmport"); Client.Start(mmAddress != null ? mmAddress : mmServerDatas.address, mmPort != null ? int.Parse(mmPort) : mmServerDatas.port, OnMMReady, OnConnectionFail, debug); _createGameMaster = createGameMaster; _defaultWorld = World.DefaultGameObjectInjectionWorld; }
public MyUdpServerForm() { myUdpServer = new MyUdpServer(1234); myUdpServer.MessageWasReceivedEvent += new EventHandler(myUdpServer_MessageWasReceivedEvent); InitializeComponent(); }