9,868,710 members (32,173 online)
Visit CodeProject.TV
Discuss CodeProject.TV
Sign in
Email
Password
Forgot your password?
Sign in using
home
articles
Chapters and Sections
>
Search
Latest Articles
Latest Tips/Tricks
Top Articles
Beginner Articles
Technical Blogs
Posting/Update Guidelines
Article Help Forum
Article Competition
Submit an article or tip
Post your Blog
quick answers
Ask a Question
View Unanswered Questions
View All Questions...
C# questions
ASP.NET questions
VB.NET questions
C#4.0 questions
C++ questions
discussions
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work & Training Issues
Design and Architecture
ASP.NET
JavaScript
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
Adobe Technologies
C#
Free Tools
Objective-C
Ruby On Rails
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
.NET Framework
Mobile
VS 11 & .NET 4.5
Sharepoint
Silverlight / WPF
Visual Basic
Web Development
Site Bugs / Suggestions
features
Component & Service Catalog
Competitions
News
The Insider Newsletter
Newsletter archive
Surveys
Product Showcase
Research Library
CodeProject Stuff
community
The Insider News
The Lounge
The Weird & The Wonderful
The Soapbox
Press Releases
Who's Who
Most Valuable Professionals
Company Listings
Non-English Language
>
General Indian Topics
General Chinese Topics
help
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
Site Map
Advertise with us
Employment Opportunities
About Us
The default search term operator is
AND
.
You can use brackets,
AND
,
OR
, and
NOT
to improve your search. For example:
C# AND NOT(VB or SQL)
A query of a single
*
will return everything, filtered by any filters.
Filter examples:
Search by Author
author:"author name"
Filter by tag
tag:C#
or
tag:(C++ or Java)
Wildcard search
use "?" or "*" eg.
gr?d
or
gr*
44 Results
Search
Everything
Articles
Technical Blogs
Tips & Tricks
Questions
Answers
Forum Messages
News Items
Catalog Items
Videos
Training Courses
Just My Stuff
My Bookmarks
Sort by
Relevance
Rating Asc
Rating Desc
Title Asc
Title Desc
Author Asc
Author Desc
Date Created Asc
Date Created Desc
Date Modified Asc
Date Modified Desc
Price Asc
Price Desc
Duration Asc
Duration Desc
Match
All Fields
Title
Description
Author(s)
Tags
Any Date
Last 12 hours
Last 24 hours
Last week
Last 2 weeks
Last month
Last 3 months
Last 6 months
Last year
January
February
March
April
May
June
July
August
September
October
November
December
Rating Range
All - Including Unrated
1.0 - 5.0
2.0 - 5.0
3.0 - 5.0
4.0 - 5.0
4.5 - 5.0
4.8 - 5.0
5.0
Advanced Filters:
Article Topics
All Topics
Desktop Development
Web Development
Mobile Development
Cloud Computing
Enterprise Systems
Database
Multimedia
Languages
Platforms, Frameworks & Libraries
General Programming
Graphics / Design
Development Lifecycle
General Reading
Third Party Products
Mentor Resources
Article License
All Licenses
CPOL
CDDL
Ms-PL
MPL
CPL
Eclipse
MIT
BSD
Apache
CC (ASA 2.5)
Zlib
Public Domain
CC (Attr 3U)
CC (ASA 3U)
LGPL3
GPL3
Forums
All Forums
Feature Forums
General Programming
Web Development
Product Lifecycle
Database & SysAdmin
General Discussions
Non-English Language
Catalog Category
All Categories
Books & Training
Charting & Graphing
Components, Controls, Libraries
Data Manipulation & Mining
Database Tools
Debugging
Documentation & Help
Financial, Math & Scientific
Frameworks & APIs
General Development Tools
GIS & Maps
Graphics & 3D Modeling
Hardware and Robotics
Hosting
IDEs
Imaging
Mobility
Multimedia
Networking
Performance and Profiling
Programming Languages
Project Life-cycle Management (ALM)
Reporting
Search
Security
Setup & Deploy
System Adminstration
Utilities
Virtualization
Web Design/Development
Catalog License
All Licenses
Commercial
Fully Function Evaluation version
Limited Functionality Trial
Limited Time Trial
Shareware
Free For Personal Use
Freeware
Page 1 of 1
Page Size:
10
·
25
·
50
Author filtered by: ayesha hassan
[x]
Handle postthreadmessage() inside a thread which is blocking in while(1) loop or use “Event Driven Sockets”
by
ayesha hassan
Question
14 May 2013
license:
CPOL
I have a single server multiple client udp application. There is a single thread (thread#1) with a single socket (socket#1) to receive data from client#1 continuously. The task of this receiving thread is to continuously receive data at its socket.I have a button which says "Send data to...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Win32
Visual-Studio
programming
socket
udp
Networking
Network
Sockets
Handle postthreadmessage() inside a thread which is blocking in while(1) loop
by
ayesha hassan
Question
14 May 2013
license:
CPOL
I have a single server multiple client udp application. There is a single thread (thread#1) with a single socket (socket#1) to receive data from client#1 continuously. The task of this receiving thread is to continuously receive data at its socket.I have a button which says "Send data to...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Win32
Visual-Studio
Threading
threads
programming
socket
Sockets
Add Auto Scroll to a window with multiple buttons
by
ayesha hassan
Question
14 May 2013
license:
CPOL
I have created a window and added almost 50 buttons to it. But the problem is that I can only see a few of those buttons as my window does not scroll up/down or left/right to show me the remaining buttons.If my window is an edit box, I can easily add AutoScroll to it i.e. as soon as the text...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Win32
Visual-Studio
programming
Scrollbar
Scrolling
Blocking sockets v/s non-blocking sockets in multi-threaded single server multiple client application.
by
ayesha hassan
Question
12 May 2013
license:
CPOL
I had been working on a Server Client aplication where Server is going to service(sendto + receivefrom)'x' number of Clients at a time. For this purpose, I have created 'x' number of threads on Server side so that each thread is dadicated to one single client. Inside each thread there is a...
General Programming
»
Uncategorised Quick Answers
»
General
Windows
Win32
Visual-Studio
Server
programming
socket
udp
Networking
Network
Sockets
How network event FD_WRITE is generated when using Event Driven Sockets.
by
ayesha hassan
Question
9 May 2013
license:
CPOL
I am working on newtwork event based socket application. When client has sent some data and there is something to be read on the socket, FD_READ network event is generated.Now according to my understanding, when server wants to write over the socket, there must be an event generated i.e....
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Visual-Studio
Events
programming
Networking
Network
eventhandler
fread() fails after reading complete contents of text file
by
ayesha hassan
Question
9 May 2013
license:
CPOL
I have written this code which reads contents of text file into a buffer and sends the buffer over the socket until end of file.The code works fine and after complete file is sent to over the socket, fread() fails, however, according to my undersanding when complete file is sent over the...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Win32
file
Text
Read a text file line by line and save each line in the buffer irrespective of data type.
by
ayesha hassan
Question
9 May 2013
license:
CPOL
I want to read one line of the text file, save it to a buffer, send the buffer over a udp socket and then go and read the second line and so on..So far, since I knew the data type of the text to be read from the text file, I had been using fscanf() to read each line from the text file. But...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Win32
programming
file
socket
udp
Text
Sockets
line
fopen() opens the text file successfully for sometime and fails after a specific time
by
ayesha hassan
Question
8 May 2013
license:
CPOL
I am trying to send a text file at a socket after every 10ms. The code works fine and keeps on sending the text file over the socket after an interval of 10ms. But after some period of time (like after 3-4 minutes), fopen() fils (though fopen() works fine for some duration) and I get an error...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Win32
Visual-Studio
file
Errors
Text
ErrorHandling
“Debug Assertion Failed. Expression: (_osfile(fh) & fopen)” error and Fatal Error in visual studio 2008
by
ayesha hassan
Question
8 May 2013
license:
CPOL
My following code is compiled successfully and runs perfectly for sometime handling 40 clients but after sometime, it gives an error "Debug Assertiion Failed expression: (_osfile(fh) & fopen)".I searched on internet and found a solution:Project + Properties, Configuration properties,...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Win32
Visual-Studio
programming
Errors
ErrorHandling
Debugging
assertion
Debugger
Run-Time Check Failure # 2 - Stack around variable 'thread no' was corrupted
by
ayesha hassan
Question
8 May 2013
license:
CPOL
My following code gives an error "Run-Time Check Failure # 2 - Stack around variable 'thread no' was corrupted." if I add a "break" inside my if statement. I have also hghlighted this "break" inside the code. If I remove thi "break", the error is removed.Can anyone explain me please why does...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Win32
Visual-Studio
programming
Errors
ErrorHandling
Unable to copy multiline text file to a buffer
by
ayesha hassan
Answer
8 May 2013
license:
CPOL
opening the file in binary mode solved the problem :)fopen must be as follows:FILE *fp = fopen("File.txt", "r+b");
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
programming
file
Text
Unable to copy multiline text file to a buffer
by
ayesha hassan
Question
7 May 2013
license:
CPOL
I am trying to copy a text file to a buffer in order to send it over the socket. As soon as the text file does not have any newlines (or \n), the file is successfully copied into buffer. But, whenever there are multiple lines in a text file, I get an error, "Unable to copy file into...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
programming
file
Text
CPU Usage 100% when creating 3 threads and using WSAWaitForMultipleEvents() and WSAEnumNetworkEvents()
by
ayesha hassan
Question
7 May 2013
license:
CPOL
I have created 3 threads each thread has one socket each. Inside each thread, socket is made "Event Driven" and whenever data becomes available for reading, an event is generated.The code works fine but it takes CPU Usage upto 100% which is surely undesirable. I think I have made some...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Threading
threads
Events
programming
udp
multithreading
event
WSA
, +
Unable to create multiple threads using for loop
by
ayesha hassan
Question
6 May 2013
license:
CPOL
I am trying to create 3 threads using a for loop. Following is my code snippet:DWORD WINAPI ThreadProc0(LPVOID param){ return 0; }DWORD WINAPI ThreadProc1(LPVOID param){ return 0;}DWORD WINAPI ThreadProc2(LPVOID param){ return 0;}int WINAPI WinMain(...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Win32
Threading
threads
programming
Making udp sockets non-blocking by making the socket Event Driven
by
ayesha hassan
Question
6 May 2013
license:
CPOL
I am trying to make my Socket "Event Based". Following is what i tried:VOID createServerSocket(){ WSADATA wsa; //Initialise winsock// if (WSAStartup(MAKEWORD(2,2),&wsa) != 0) { //"WinSock Initialization FAILED", } //Create a socket// ...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Win32
programming
socket
udp
Network
Sockets
Making udp socket non-blocking
by
ayesha hassan
Question
3 May 2013
license:
CPOL
I had been working on non-blocking udp socket. The code that I had developed generates a Window Message whenever there is any data to be read over the socket. Below is the code snippet:void createSocket(HWND hwnd){ ///Socket Binding/// WSADATA wsa; ///Initialise winsock/// ...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
programming
socket
udp
Sockets
Asynchronous
WSA
Passing pointer to SOCKADDR_IN and SOCKET in a function
by
ayesha hassan
Question
2 May 2013
license:
CPOL
I have a function createServerSocket(). This function can be accessed by multiple threads for creating their sockets.I want each thread to pass three arguments, a *socketIdentifier, sockaddr_in* and specific port number to createrServerSocket() function, so that each thread has a unique...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Win32
programming
function
Pointer
functions
Can two Threads use same Thread Procedure?
by
ayesha hassan
Question
1 May 2013
license:
CPOL
s it possible for two threads to use a single function "ThreadProc" as its thread procedure when CreateThread() is used.HANDLE thread1= CreateThread( NULL, //Choose default security 0, //Default stack size ...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Threading
threads
multithreading
How to create multiplethreads each with different ThreadProc() function using CreateThread()?
by
ayesha hassan
Question
1 May 2013
license:
CPOL
I have successfully created a single thread using CreateThread().Now I want to create 'n' number of threads but each with a different ThreadProc().I have tried the following code but using it, 'n' number of threads are created all performing the same task (since Threadproc() function af...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Win32
Threading
threads
programming
multithreading
create
Chances of data collision when using single udp socket for send() and receive()?
by
ayesha hassan
Question
30 Apr 2013
license:
CPOL
I have developed a udp application in which a single server is able to handle 'x' number of clients. Inside my server, there is a primary thread keeps on receiving requests/data continuously from the clients and keeps saving the information of each client in a list.As soon as a request comes...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
programming
udp
Networking
Sockets
using WSAAsyncSelect() function in server to handle multiple clients
by
ayesha hassan
Question
19 Apr 2013
license:
CPOL
I have a single asynchronous socket at my server side. whenever there is something to be read or written on the socket, a window's message is generated. Right now there is only one single asynchronous socket on the server that handles requests of more than one client I guess. But I am not sure...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
programming
udp
Networking
Sockets
Can multithreading be implemented on a single processor system?
by
ayesha hassan
Question
19 Apr 2013
license:
CPOL
I have always followed the concept that multithreading can only be implemented on multiple processors system where there are more than one processor to be assigned to each thread and each thread can be executed simultaneoulsy. There is no scheduling in this case as each of the thread has...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
multithreading
single
fscanf() returns negative value
by
ayesha hassan
Answer
19 Apr 2013
license:
CPOL
[This post is not an answer and should be removed — SA]Adding rewind(fp) just before fscanf() solved the problem :)
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Win32
programming
Text
Using asynchronous sockets for server handling multiple clients
by
ayesha hassan
Question
19 Apr 2013
license:
CPOL
I have developed a single server multiple client udp application using multithreading. Now I want to implement the server using asynchronous sockets so that it may be able to handle multiple clients at a time. Will this approach work fine? Is it correct to use asynchronous socket if you want to...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
programming
udp
Networking
Sockets
Possible alogrithms of handling 40 clients in a single udp server
by
ayesha hassan
Question
15 Apr 2013
license:
CPOL
I am working on udp server/cient application. I want my Server to be able to handle 40 clients at a time. Right now I am using the approach of creating one receiving thread which continuously receives data and one sending thread for sending data if required. Since the socket queue is large...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
programming
udp
Networking
Binding 40 Sockets to 40 different IP addresses
by
ayesha hassan
Question
12 Apr 2013
license:
CPOL
I am working on udp server/client application. I want my single server to handle 40 clients at a time. For this, I want to create 40 dedicated threads, each dedicated for one single client. Since there are 40 threads one for each client, I want to create 40 dedicated sockets as well. But the...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
IP
programming
udp
Network
Sockets
Maximum size of Receive Buffer/Queue in udp socket
by
ayesha hassan
Question
11 Apr 2013
license:
CPOL
I have developed a udp server/client application in which server has one socket at which it continuously receives data from 40 clients. Now I want to know that what happens if all of the 40 Clients send data at a time? According to my understanding, data must be queued in receive buffer and next...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
programming
udp
Networking
Sockets
sethostname identifier not found error.
by
ayesha hassan
Question
11 Apr 2013
license:
CPOL
I want to set the name of my local host. I am using sethostname() function but I get an error as follows:error C3861: 'sethostname': identifier not found.Below is the code snippet:WSADATA wsa;///Initialise winsock///if (WSAStartup(MAKEWORD(2,2),&wsa) != 0) { //Socket...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Win32
programming
Networking
Making recv_from function non-blocking
by
ayesha hassan
Question
10 Apr 2013
license:
CPOL
I am working on udp server/client application. For finding out if any of the client is down, server sends a handshake message to the client. Then, the server waits for the response of client to send some data to assure that the client is active. For this the server blocks in call to recv_from()...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
programming
udp
Networking
Copying contents of a text file into a buffer (win32api)
by
ayesha hassan
Question
10 Apr 2013
license:
CPOL
I have some data in a text file. Now I want to copy this data to a character buffer so that I can send it iver a udp socket. How can I copy the data in a text file to a buffer? I have tried fread for this purpose but it also copies some of the redundant data, though I have specified only the...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Win32
programming
Text
Clear contents of a Text File
by
ayesha hassan
Question
10 Apr 2013
license:
CPOL
I am working on a sever/client applicataion. I want to maintain information of all active clients in a text file named "Information.txt". I update this text file after every 3 seonds. So, I want the text file to clear all of its contents after every 3 seconds without deleting the file. Is there...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
programming
file
Text
fscanf() returns negative value
by
ayesha hassan
Question
1 Apr 2013
license:
CPOL
I am using fscanf() function to read data line by line from a text file. It was functioning fine but suddenly I don't know what mistake I made and now the function returns a negative value. below is my code snippet: FILE *fp; char ip[16]; int port; fp =...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Win32
programming
Text
Read a line from text file and delete it
by
ayesha hassan
Question
1 Apr 2013
license:
CPOL
I want to read a text file line by line, perform some checks, and if the line is not required, delee it. I have done the code for reading line, but I don't know how to delete that line if it is not required by me. Please help me find the simplest method for deleting the line. Here is my code...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
programming
file
delete
how does the server handles if the client goes down in udp client/server application
by
ayesha hassan
Question
29 Mar 2013
license:
CPOL
I wanted two functionalities to be implemented on my udp server application. 1. Creating thread that continuously receives data coming from any client. 2. Creating a thread that continuously sends data on server socket after specific time period and waits for reply from client (handshake...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
programming
udp
Network
creating two sockets at udp server at a time, how to bind()?
by
ayesha hassan
Question
29 Mar 2013
license:
CPOL
I want two functionalities to be implemented on my udp server application. 1. Creating thread that continuously receives data coming from any client. 2. Creating a thread that continuously sends data on server socket after specific time period and waits for reply from client. (I implemented this...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Win32
programming
udp
Network
Text File created by CreateFile() function is not displayed
by
ayesha hassan
Question
28 Mar 2013
license:
CPOL
I am trying to open a text file. if the file does not exists, then it must be first created and opened. I have written the following piece of code for this purpose. The code works fine, it also creates file inside BIN folder but still I cannot see any file get opened when I exexute this code....
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Win32
programming
Text
Sending same information from UDP server to all clients at a time without using Broadcast.
by
ayesha hassan
Question
28 Mar 2013
license:
CPOL
I want to send same information after specific time intervals from UDP server to all clients at a time without using Broadcast. For this purpose, I am thinking of adding information of each Client which tries to communicate with the Server in some sort of text file, and then, when I want to...
General Programming
»
Uncategorised Quick Answers
»
General
C
Win32
programming
udp
Network
how to do horizontal and vertical search for a word in a 2 dimensional character Array using c
by
ayesha hassan
Answer
28 Mar 2013
license:
CPOL
Try this :) and make changes accordingly!char *arr[2][2] ; arr[0][0]="Apple"; arr[0][1]="Book"; arr[1][0]="Cat"; arr[1][1]="Door"; for(int i=0;i
General Programming
»
Uncategorised Quick Answers
»
General
C
Is Threading the best way to handle 40 Clients at a time in UDP Server or is there any other better way?
by
ayesha hassan
Question
28 Mar 2013
license:
CPOL
I am working on a UDP Server Client Application. I want my Server to be able to handle 40 Clients at a time. I have thought of creating 40 threads at Server side, each thread handling one Client. Clients are distinguished on the basis of IP Addresses and there is one thread for each unique IP...
General Programming
»
Uncategorised Quick Answers
»
General
C
Win32
programming
udp
Network
How to handle when a Client or Server is Down in a UDP Application
by
ayesha hassan
Answer
28 Mar 2013
license:
CPOL
A simple implementation is as follows:Have a background thread keep sending those messages and waiting for replies.Upon receiving replies, you can populate some sort of data structure or a file with a list of alive devices.Your other main thread (or threads) can have the following...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Win32
udp
How to handle when a Client or Server is Down in a UDP Application
by
ayesha hassan
Question
27 Mar 2013
license:
CPOL
I am developing a windows application for Client Server communication using UDP, but since UDP is connectionless, whenever a Client goes down, the Server does not know that Client is off and keeps sending the data. Similar is the case when a Server is down. How can I cater this condition that...
General Programming
»
Uncategorised Quick Answers
»
General
C
Windows
Win32
udp
Single Server, Multiple Clients UDP Application in C (Winsock)
by
ayesha hassan
Question
11 Mar 2013
license:
CPOL
I have created single Server and Single Client echo application. It works fine for single server and single client. But now I want to make it more practical by handling multiple clients for a single Server. I came accross the idea of using listen() function at Server side to handle multiple...
General Programming
»
Uncategorised Quick Answers
»
General
C
Problem :( Help me Please!!!
by
ayesha hassan
Forum Message
1 Mar 2013
int PASCAL WSAAsyncSelect(Socket, AH_Glb_hwnd, MY_MESSAGE_NOTIFICATION,(FD_ACCEPT | FD_CONNECT | FD_READ | FD_CLOSE)); This line gives me the following error: Warning 1 warning C4229: anachr
General Discussions
»
Programming Windows Tcp Sockets In C++ For The Beginner
Great Document
by
ayesha hassan
Forum Message
1 Mar 2013
A very helpful tutorial, really helped me a lot. and loved the way you explained the things. Thank you :)
General Discussions
»
Programming Windows Tcp Sockets In C++ For The Beginner
Page 1 of 1
First
·
Prev
·
Next
·
Last
Advertise
|
Privacy
|
Mobile
Web02 | 2.6.130513.1 | Last Updated 14 May 2013
Copyright ©
CodeProject
, 1999-2013
All Rights Reserved.
Terms of Use
Layout:
fixed
|
fluid