16,019,273 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Bram van Kampen (Top 18 by date)
Bram van Kampen
11-May-12 19:28pm
View
Well I have One thread per Connection, but use WSAAccept to limit it to a reasonable number. I also have (on a Seperate thread) a Garbage Collection Service, that kills stale sockets. Any Sockets, not Kicked within a period, get Closed, the thread running it also gets closed.
The Socket (or Thread) gets kicked when traffic passes tru it, and a new period starts.
Each WSAAccept(...) is not sent off into the dark on a New thread, and a New Socket. The situation is carefully monitored, and the Callback in WSAAccept() will return 'CF_REJECT' if Too Many Sockets are open already.
Bram van Kampen
15-Apr-12 20:44pm
View
Thanks,
With PARANOID turned on I thought I created a Pointer on the Local Stack, pointing to a Global Object This pointer is passed to the thread's stack, but still points to the same global object. I take it that all that is done when 'CreateThread' returns. MS Documentation states specfically that 'CreateThread' may return before the Newly Started thread completes( Otherwise 'CreateThread' would be pointless)or even before it commences!
I had Bad feelings about the code without 'PARANOIDE', and you confirm my bad feelings about it. The problem with synchronisation objects is, that I would have to apply the Lock in the Parent thread, and release it from the Child Thread. This is Something that does not sound right. (Having said that, maybe it is perfectly acceptable).
Apart from that, what I'm trying to do is not exactly breaking the mould. Useage of the 'CreateThread' function is peppered through all MS Apps.
I can only assume that they made it 'Usefull'. Unless if anyone comes up with a different Idea, I will for now assume that You're right in considering the 'PARANOIDE' option as threadsafe.
Thanks;
Regards :)
Bram van Kampen
12-Apr-12 20:41pm
View
QQQ
How can a Single threaded app endup creating an unlimited number of sockets! I do not understand this at all! Surely a single threaded function can count the number of created sockets in a single global variable. (Does not need protection, because there is only one thread.) The CallBack of WSAAccept can reject the new socket, if too many are open.
At any rate, this is a latter day issue. For now I just want to establish basic connectivity.
Regards,
Bram.
Bram van Kampen
12-Apr-12 15:37pm
View
Well, One thing at a time. I'm at experimental stage 0, and the first concern is what type of incantations are required to ensure that after the 'send(h_sockClient...)' , and going round the loop, 'listen(hSock,100)' works properly again. I'm debuging this with one client, and efficiency does not (yet) come in to it. I would have thought that for this testing purpose, one thread should suffice.
:)
Bram.
Bram van Kampen
9-Apr-12 19:48pm
View
enhzflep below got it right!
Bram van Kampen
18-Jan-12 21:47pm
View
Solution 1 fails because the Download is in an ISO Format, for which I have No Drivers
Solution 2 at least gives me the Header File.( From Linux Wine) I am aware that Headers cover Libraries, but I am also aware that most of the API is already included in Windows Libs.
Bram van Kampen
8-May-11 7:00am
View
I am already using that. However, that still decorates the name with a leading underscore. i.e. Foo() becomes _Foo. How do I loose that leading Underscore.
Bram van Kampen
23-Mar-11 4:43am
View
See Comment to Solution 1
Bram van Kampen
23-Mar-11 4:42am
View
It is NOT the Computer name. It appears to be the name of my email host. (in my case the email host provided by AOL). I assume this can be found somewhere in the registry, the question is 'WHERE'.
Bram :)
Bram van Kampen
17-Jan-11 18:45pm
View
BTW, Where is the User Manual for all this.
:)
Bram van Kampen
17-Jan-11 18:43pm
View
Bram,
Thanks for the vote.
You posted text above "turned out to be the answer", etc. is not an answer. Also, I would not receive a notification on this post. So you were not supposed to post it. If you want to preserve this text, you can go to my answer, click Comment and paste it there. The same text under "Answer" category can later be removed, because of this requirement.
Thank you. - SAKryukov yesterday at 9:25 PM
Enter your reply below and click the Submit button.
.Add
Is This then the Correct way of doing it?
Prety Ugly(Not your Fault), I just hate to have to write text in a Letterbox size Comment Box! Reminds me of 'edlin'.
And why should you not receive notification when I say Thanks and Confirm Usefullness. (Beats Me!)
Thanks for pointing out the error of my ways.
Hope to remember Next Time, but Old Habits die hard!
Regards,
Bram :)
Bram van Kampen
15-Jan-11 21:25pm
View
Sory, Maybe I should have answered here. This New CP Interface is still Strange to me! The workings have become obscure.
Bram van Kampen
15-Jan-11 21:10pm
View
I'd gladly oblige if you just explain what you mean...
:)
Bram.
Bram van Kampen
4-Dec-10 22:02pm
View
Thanks,
Found it in:-
C:\Program Files\DevStudio\VC\mfc\src
Bram van Kampen
20-Jul-10 20:31pm
View
Well, it confirms my suspicions that all bets are off. So, I'm going to do it by Hand! fread the file in bin mode, Copy it with all '/r/n'contracted to single '/n', process it, and send it out again with each '/n' replaced with a '/r/n.
(Sorry Slashes run the Wrong Way, The CP Editor deletes the Correct Slashes)
It comes back though to what I said earlier, I never accused Microsoft of inventing the concept. At the time they did not have the foresight of perpetuating a problem. If MS had not adopted the termination, it would have been assigned to history a long time ago, along with things like the Dollar Terminated String, invented by Microsoft, which was famous in MS Dos 2. Thanks and Regards, Bram
Bram van Kampen
19-Jul-10 20:31pm
View
No, fread is very much a standard library function,available both in 'C' and 'CPP' and must be supported by Microsoft, if they claim (as they do) that their compiler and API's comply with relevant ISO Standards. The standard stipulates that fread should be equivalent to a number of fgetch()calls. This would Translate things automatically. My version of the MS Library does not seem to support that.
Why would nobody use fread and fwrite in CPP. I use it daily in CPP and MFC Programs.
Bram van Kampen
26-May-10 19:31pm
View
Well I still use MFC42, and it still works! (despite it being disconinued) In my last (9 year old project) I never used exceptions. I never needed them, Error conditions were propagated down the line in my code. It was Hard Work, as it involved a total of 12 modules.
I want to do it different this time.
Bram van Kampen
8-May-10 20:28pm
View
you answered my question correctly, which led me to:
'http://www.codeproject.com/KB/dialog/pretransdialog01.aspx?msg=1897183'
(Sorry tried several times, but, cp does not allow to ad links.)
Issue Resolved!!, and Many Thanks
Show More