Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Adding a socket to a GUI application
Adding a socket to a GUI application [message #48129] Mon, 22 May 2017 10:15 Go to previous message
Giorgio is currently offline  Giorgio
Messages: 218
Registered: August 2015
Experienced Member
Hi there,
I have my application with its GUI that connects to a db and makes stuff. It goes ok. Now I need the ability for the application to listen to a port and, when it receives a specific command, the application needs to modify its behaviour.

My main.cpp is like this

#include <CtrlLib/CtrlLib.h>
#include <Sql/sch_schema.h>
#include <Sql/sch_source.h>
//Other includes

using namespace Upp;

GUI_APP_MAIN
{
	String User, Pass, Schema, IP;
	int port;
	
	User = "fooo";
	Pass = "bar";
	Schema = "test";
	IP = "192.168.1.2";
	port = 3306;

	//Connection to the DB
		MySqlSession session;
		if(err_conn = session.Connect(User, Pass, Schema, IP, port)) {
			SQL = session;
			SqlSchema sch(MY_SQL);
			All_Tables(sch);
		}
		else {
			SetExitCode(1);
		}

	//Main window of the GUI
	HomeScreen hs;
	hs.Run();
	
}


I have no experience in sockets, but my guts tell me that I have to fork somewhere before the .Run() command.
Any suggestion (including links to relevant documentation and RTFM) is appreciated.
Regards,
Gio

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: print the Http Request before sending it
Next Topic: I don't understand Moveable
Goto Forum:
  


Current Time: Wed Apr 24 13:38:24 CEST 2024

Total time taken to generate the page: 0.02439 seconds