Click here to Skip to main content
Page 1 of 1
Page Size: 10 · 25 · 50


Author filtered by: ayesha hassan [x]
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...
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...
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...
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...
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....
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...
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...
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...
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,...
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...
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");
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...
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...
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(...
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// ...
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/// ...
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...
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 ...
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...
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...
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...
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...
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 :)
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...
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...
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...
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...
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...
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()...
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...
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...
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 =...
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...
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...
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...
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....
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...
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
C
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...
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...
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...
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...
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
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 :)

Page 1 of 1


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