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 » U++ Library support » U++ MT-multithreading and servers » Need a working simple example of using sockets with GUI in U++
Re: Need a working simple example of using sockets with GUI in U++ [message #40469 is a reply to message #40460] Mon, 05 August 2013 23:06 Go to previous messageGo to previous message
Oblivion is currently offline  Oblivion
Messages: 1094
Registered: August 2007
Senior Contributor
koldo wrote on Mon, 05 August 2013 10:40

Hello Lectus

Few weeks ago I began to prepare some functions to communicate different programs in different computers using sockets (in plain words, I am a dummy in sockets Rolling Eyes ).

Based in U++ Reference/SocketClient and SocketServer it was very simple. It is also very easy to use threads in U++ (just following a couple of simple rules: 1. debug your code before being multithreaded, 2. do not share variables but if you do it, use for example INTERLOCKED), so including in the same program the client and a multi threaded server has been straightforward.

Where are the problems you find?


Hello Koldo, I agree Lectus.

IMO, it is generally a better practice to use sockets with threads in a GUI application, but U++ needs a basic single-threaded non-blocking client/server socket example too. While I can use a traditional low level platform dependent socket routines to handle nonblocking socket operations, I have to admit that I find U++ TcpSocket class a bit confusing. A code snippet or a barebone example on, say, how to handle basic nonblocking read()/Get() and write()/put() operations with TcpScoket, and how to cancel or do "other stuff" when socket would block (e.g, canceling the operation) would be really useful.


Regards.


[Updated on: Mon, 05 August 2013 23:10]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Previous Topic: url-encoded binary data in URL query string - how to decode properly?
Next Topic: Lost socket error (and how to get it)
Goto Forum:
  


Current Time: Wed May 15 01:25:44 CEST 2024

Total time taken to generate the page: 0.02941 seconds