15,895,084 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 Javascript questions
View Visual Basic questions
View Python 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 Mahmoud_Gamal (Top 86 by date)
Mahmoud_Gamal
7-Aug-19 6:58am
View
ok but this issue occur only when two invoice posting at same time and it swapped with other invoice data for this reason i suggest that
Mahmoud_Gamal
6-Dec-16 5:04am
View
thanks for improve question and your comment why you was fiddled by my question is it not clear and i will check slim framwork
Mahmoud_Gamal
16-Nov-16 13:34pm
View
are you mean set timeout for every thread process
Mahmoud_Gamal
1-Nov-16 4:47am
View
thanks for comment
i have a problem in pull data if i pull data and insert it into client it also return
to server again
Mahmoud_Gamal
18-Aug-16 3:56am
View
thanks i correct the error
singleton has private constructor and at least one static function and i just write
template
Mahmoud_Gamal
5-Aug-15 6:47am
View
ok but when send and recv from windows to this device work well
but when change windows ->unix the system sometimes hange sometimes work well
Mahmoud_Gamal
5-Aug-15 6:45am
View
thanks for replay but i want to complete sequence no hang at half
the code run sometimes right some times complete
so i want guarantee to send guarantee to receive
Mahmoud_Gamal
23-Jun-15 3:50am
View
but i see unlike when i send data in range unsigned not signed and i receive wrong data i do like your solution but doesn't work well
Mahmoud_Gamal
11-Jun-15 4:31am
View
thanks i will try for that
thanks alot :)
Mahmoud_Gamal
10-Jun-15 4:05am
View
thanks for response
but some time connected server hang recv still block for ever
Mahmoud_Gamal
7-Jun-15 7:45am
View
thanks for that this problem occur where server restart and reset its configuration where problem are you think
Mahmoud_Gamal
7-Jun-15 7:34am
View
i cant debug due to on unix i write on text and run code with display message it connect then send first command and send second then replay
when send third command may be connection loss or time out but when telnet normally it return data well
this problem suck me
thanks for response
Mahmoud_Gamal
7-Jun-15 7:19am
View
is there configuration on aix solve this problem of timewait
Mahmoud_Gamal
7-Jun-15 6:43am
View
ok thanks for this tips
but why it working for some server but other not
but when i use telnet command i work well i work on unix platform
when i reboot system this problem occur before thant there is nooo problem
Mahmoud_Gamal
7-Jun-15 6:31am
View
thanks alot
but i change code as you say
and the time out occur for some server although when use telnet command line it return data
Mahmoud_Gamal
7-Jun-15 4:42am
View
it work correctly for almost server expect some one
so i ask is the read function get all data in all cases or not
Mahmoud_Gamal
7-Jun-15 4:41am
View
ok but max wait is 35
and it work correctly for almost server expect some one
so i ask is the read function get all data in all cases or not
----
memset i use it dure to under it i read all data for single if memset remove
may be add return response of previous command + current command
Mahmoud_Gamal
26-Mar-15 7:26am
View
yup
Mahmoud_Gamal
10-Mar-15 6:13am
View
O_NONBLOCK not recognize on AIX7.1 i use FIBNREAD
Mahmoud_Gamal
10-Mar-15 5:44am
View
iam so sorry but i write quickly and capslock open :D
Mahmoud_Gamal
9-Mar-15 11:12am
View
OK IF THIS CASE YOU SAY OCCUR HOW TO OVERCOME ALSO
DUE TO THIS SERVER MAY BE WRITE TRUE TO IT BUT NOT RESPONSE SO I WANT TO SOLVE WAITING
Mahmoud_Gamal
31-Jan-15 15:28pm
View
i can't know problem with this piece of code but
try to debug on selection changing event on drop down list
and check when call select function the event occur one or more one time
Mahmoud_Gamal
1-Jan-15 15:57pm
View
your solution is logic and i will do it but there are service that connect to this all time with no limit need all to handle
Mahmoud_Gamal
16-Dec-14 6:57am
View
i work on AIX ibm 7.1 server with with 16 core every core 3.7 GH and ram 16 G ram
so i think this is no probelm and it it background service so difficult to debug
i use instead show message
Mahmoud_Gamal
9-Nov-14 9:21am
View
are you solve it
i face it now
Mahmoud_Gamal
3-Nov-14 7:53am
View
not work
Mahmoud_Gamal
3-Nov-14 4:39am
View
why you check on previous on datarowbound event and this event occur every row may be case terminate your program in first bound row
Mahmoud_Gamal
27-Oct-14 17:31pm
View
i know it wrong it just dummy code i want to cast
Mahmoud_Gamal
27-Oct-14 4:31am
View
it compile fine but i need to send unsigned char
i will update question
sorry for this
Mahmoud_Gamal
27-Oct-14 4:02am
View
not tcp but the data in accept in write function
Mahmoud_Gamal
27-Oct-14 4:01am
View
Deleted
it compile fine but i need to send unsigned char
i will update question
sorry for this
Mahmoud_Gamal
29-Sep-14 5:31am
View
I MEAN THAT multi-thread application every new thread have access to database
and this code
m_Manager->c_section.Lock();
int res=m_Manager->m_DB.BookFreeTestHead("AXE",&h);
m_Manager->c_section.Unlock();
printf(" res is %i ",res);
in thread and another threads also BookFreeTestHead but i did't want two thread have the same free test head
Mahmoud_Gamal
16-Sep-14 5:58am
View
Ok thanks for your time ,respect and your replay
i will try agine if i fail i will post question with this code and add other relevant information.
:) :)
Mahmoud_Gamal
16-Sep-14 2:13am
View
ok this code snippet inside parse function due to you say i'am not ensure
parse function do :)
Mahmoud_Gamal
15-Sep-14 6:55am
View
i accept it to write a comment on it only
Mahmoud_Gamal
15-Sep-14 2:05am
View
thanks for advice but a problem but the same problem is still not solved
the function parse take a pointer of vector list and i change of it
then i use it after function return 0 value to ret variable so function it work correctly
Mahmoud_Gamal
15-Sep-14 2:02am
View
no i use on windows visual stdio 2012 and use on linx gcc 4.9
but on unix xlc also the same problem
it also run on oracle linux only
Mahmoud_Gamal
14-Sep-14 7:50am
View
i sorry for new question but i solved it it linux and run then i see your answer i try it in windows problem doesn't solve
Mahmoud_Gamal
14-Sep-14 6:31am
View
i sorry for this i mean the same code dosen't run on windows but it run well on linux
Mahmoud_Gamal
14-Sep-14 6:01am
View
it work on linux but windows no
vector<cparsertoken*> &cop =mycom->param;
// mycom->get_first();
iter = cop.begin();
int i = 0;
for(;iter!=cop.end();iter++)
{
k = ParseTokens(*iter,NULL,token, temp, polist,true);
if(k<0)
{
return k;
}
}
Mahmoud_Gamal
14-Sep-14 5:19am
View
it already like that i will change it now in post sorry
Mahmoud_Gamal
14-Sep-14 4:51am
View
it return vector iterator incompatiable and program stop at comment //program stop
Mahmoud_Gamal
13-Sep-14 3:38am
View
in debug viewer it appear that it call deconstructor of TCPserver socket and
shut down it it return this error socket is closed so what about when i bind socket
agine in deconstructor to listen agine or this way not optimized
Mahmoud_Gamal
11-Sep-14 9:20am
View
iam sorry for that but it thousand of line of code and also it work well for 30 min then stop and start
i post this question expecting may be a common guideline for this probelm
Mahmoud_Gamal
11-Sep-14 8:19am
View
this windows service is listening on port 6000 to handle any request on it by tcp conncetions
there is main thread tcp for listening and all chaild tread that handle connection and process request but after 30 min the service close listening socket up normal
Mahmoud_Gamal
27-Aug-14 4:51am
View
thank you , i have been able to link the library
Mahmoud_Gamal
10-Aug-14 3:57am
View
i know but when i commentated while true that contain read and write for each connected client the accepting more client work perfectly but every client open session read first and server return response one time i wont every client write and read from server all time
Mahmoud_Gamal
9-Aug-14 17:22pm
View
Thanks for time but it also did't solve the problem is if first thread that accept connection
accept client and begin to read and write the thread that accept wait to end read of the read thread but i need accept run all tim eand read write to other client also run and handle all time
Mahmoud_Gamal
8-Aug-14 4:03am
View
ok but re->start already do this and Handleresponse inherit from thread that call run in every drived class
Mahmoud_Gamal
6-Aug-14 7:11am
View
OK really THANKS FOR YOUR TIME :)
Mahmoud_Gamal
6-Aug-14 7:04am
View
thanks problem solved
the problem like you say in type casting
but after accept it closed thread and listing why
Mahmoud_Gamal
6-Aug-14 6:46am
View
I know i write it like this but this is not problem when i change to dynamic_cast
the server dosen't listen when i telnet on it
((ITCPServer *)&run)->Bind();
// (dynamic_cast<itcpserver*>(run))->Bind();
if i reverse comment the server dosen't fire listen thread
i really heat that
Mahmoud_Gamal
6-Aug-14 5:32am
View
(dynamic_cast<itcpserver*>(run))->Bind(); doesn't run program couldn't be run
Mahmoud_Gamal
6-Aug-14 2:53am
View
i try to print Socket variable after Socket = socket(PF_INET,SOCK_STREAM,0);
it take a specific value
but when i use it before accept
accept(Socket,(struct sockaddr*)&client,(unsigned int*)sizeof(client)))
Socket always take default value here of constructor
why this occur i call first Bind() function in main function then call start listen
Mahmoud_Gamal
5-Aug-14 15:35pm
View
this is reserved function
i talk about Socket dosent change in cooment
Mahmoud_Gamal
19-Jun-14 3:42am
View
No for what :)
Mahmoud_Gamal
19-Jun-14 3:40am
View
yes exactly i mean it :)
thanks
Mahmoud_Gamal
18-Jun-14 2:34am
View
i know but i convert string to byte must be in specific format so when i get byte in format windos-1256 cannot convert into iso-8859-1 data Lose
Mahmoud_Gamal
17-Jun-14 4:42am
View
if i use string to decrypt it must be in format iso-8859-1 else it generate error in decoding but when i use this decryption on system support only windows-1256 encoding the encrypting
string save with data lose when i get it to decript generate error
Mahmoud_Gamal
16-Jun-14 5:17am
View
i use cipher rsa encryption
i get byte by memeber function getbytes in string
Mahmoud_Gamal
16-Jun-14 5:15am
View
this in C# i want in java
Mahmoud_Gamal
19-May-14 5:32am
View
i sorry i know, may be i use wrong words but this errors not occur constantly i want to prevent it permanently for that i optimize code
if you have windows multi threading code in c++ 6 and mutex aemaphore in one project
you will help me ////////////
this code
Mahmoud_Gamal
19-May-14 3:49am
View
yes as you say my brother :) but first the stack overflow occur in say as example on the
line 20 when i use memory pointer in these variable in may be case at line 50
or not due to this is peace of threading application
Mahmoud_Gamal
18-May-14 5:05am
View
this case cause stack overflow //if i do like this
Mahmoud_Gamal
17-May-14 17:18pm
View
Deleted
this case cause stack overflow //if i do like this
Mahmoud_Gamal
16-May-14 22:52pm
View
I MEAN GAME ENGINE HAVE EXCELLENT TUTORIAL AND I CAN DO FANTASTIC GAME WITH NO RESTRICTION IN EFFECTS AND PERFORMANCE
Mahmoud_Gamal
16-May-14 22:52pm
View
thanks :)
Mahmoud_Gamal
16-May-14 13:01pm
View
Deleted
I MEAN GAME ENGINE HAVE EXCELLENT TUTORIAL AND I CAN DO FANTASTIC GAME WITH NO RESTRICTION IN EFFECTS AND PERFORMANCE
Mahmoud_Gamal
16-May-14 12:58pm
View
THANKS I WILL TRY IT REALLY I SEE CODE MORE TIME BUT I DIDN'T SEE IT I HOPE THIS TO BE THE PROBLEM THANKS VERY WELL :)
Mahmoud_Gamal
16-May-14 8:44am
View
thanks for hint i improve question :)
Mahmoud_Gamal
15-May-14 13:33pm
View
it is a
windows service the debuging data just some long address in memory <br>
<br>
but can i optimize this function or divide it into two function
Mahmoud_Gamal
15-May-14 13:25pm
View
i cant due to it thread section from big multi threading question
but what should i do
Mahmoud_Gamal
15-May-14 13:12pm
View
and this peace of code is only threading function
Mahmoud_Gamal
15-May-14 13:12pm
View
when i comment the function
m_Manager->m_DB.zte_get(terminalid,(int &)*rac,(int &)*shelf,(int &)*slot);
it run well bur if i return it the threading didn't complete the the function
Mahmoud_Gamal
15-May-14 13:10pm
View
CTCPClient* m_Client = new CTCPClient();
MTSOutputDebugString("Huawei-zte Switch SendCommand");
CTL1Response * reponse = new CTL1Response(m_Manager, "HU");
reponse->m_Tl1ParamsMap=this->m_Tl1Map;
strcpy(reponse->m_technologyid,"AXE");
strcpy(h.ip,msan.ip);
h.port = msan.port;
reponse->THip=h.ip;
reponse->THport=h.port;
//string switch_uname = "root";
//string switch_pwd = "root";
m_Client->Bind();
errorno = m_Client->Connect(h.ip,h.port);
if(errorno != 1)
{
MTSOutputDebugString("HUAWEI-zte MSAN Connection Failed");
reponse->CreateResponse(ResponseString,NO_AVAILABLE_TESTHEAD);
return ResponseString;
}
else
{
MTSOutputDebugString("HUAWEI-zte MSAN Connection sucess \n");
}
char * bbuf = new char [1000];
pots = "config\r\n";
m_Client->Write(username.c_str());
m_Client->Write("\r\n");
errorno = m_Client->Read(bbuf,300,12,":",1,&mread);
m_Client->Write((char*)pwd.c_str());
m_Client->Write("\r\n");
errorno = m_Client->Read(bbuf,800,6,"#",1,&mread);
MTSOutputDebugString((char*)bbuf);
m_Client->Write((char*)pots.c_str());
m_Client->Read(bbuf,200,5,":",1,&mread);
MTSOutputDebugString((char*)bbuf);
if(errorno<1)
{
m_Client->Disconnect();
delete m_Client;
return "HUAWEI-zte MSAN send pots failed ";
}
///////////////////////
m_Client->Write("ag\r\n");
errorno = m_Client->Read(bbuf,800,5,"#",1,&mread);
int * shelf;shelf = new int;
int * rac; rac = new int ;
int* slot;slot = new int ;
*shelf = 3;
* rac = 1;
* slot = 2;
////// not tested begin
int circit = terminalid;;
terminalid /= 32;
if(terminalid > 0)
{
//*slot = terminalid;
terminalid *= 32;
circit -=terminalid;
}
m_Manager->m_DB.zte_get(terminalid,(int &)*rac,(int &)*shelf,(int &)*slot);
sleep(5);
//////////
char * num = new char[4];
//int num1[4];
pots = "get-sunitinfo rack "+string(itoa(*rac,num,10))+" shelf "+string(itoa(*shelf,num,10))+" slot "+string(itoa(*slot,num,10))+"";
m_Client->Write(pots.c_str());
m_Client->Write("\r\n");
//sleep(5);
///////////////////////////*/
pots = "start item 29 times 1 obliged 0 unit "+ parsing(bbuf,-2)+" sunit "+parsing(bbuf,-3)+" index "+string(itoa(circit,num,10))+" \r\n" ; // get out voltage
delete []num;
delete shelf;delete slot;delete rac;
m_Client->Write("exit\r\n");
errorno = m_Client->Read(bbuf,800,3,"#",1,&mread);
m_Client->Write("112\r\n");
errorno = m_Client->Read(bbuf,100,3,"#",1,&mread);
m_Client->Write((char*)pots.c_str(),true);
errorno = m_Client->Read(bbuf,600,6,"RESULT",1,&mread);
sleep(7);
errorno = m_Client->Read(bbuf,1000,18,"#",sizeof(bbuf),&mread);
if(errorno<1)
{
delete []bbuf;
m_Client->Disconnect();
delete m_Client;
reponse->CreateResponse(ResponseString,NO_AVAILABLE_TESTHEAD);
}
if(strstr(bbuf,"User busy")!=NULL)
{
delete []bbuf;
m_Client->Disconnect();
delete m_Client;
reponse->CreateResponse(ResponseString,LINE_IS_BUSY);
return ResponseString;
}
pots = string(bbuf);
m_Client->Write("exit\r\n");
errorno = m_Client->Read(bbuf,100,5,"#",1,&mread);
m_Client->Write("logout\r\n");
m_Client->Disconnect();
delete []bbuf;//free(bbuf);
MTSOutputDebugString("\n test\n");
m_Manager->dbSection.Lock();
delete m_Client ;
m_Manager->dbSection.Unlock();
MTSOutputDebugString("\n test\n");
if(atoi(GetResultValue(pots,"Total failure count :").c_str())> 0 )
{
MTSOutputDebugString("\nFail\n");
delete []bbuf;
m_Client->Disconnect();
reponse->CreateResponse(ResponseString,NO_AVAILABLE_TESTHEAD);
delete m_Client;
delete reponse->m_GData;
delete reponse->m_db;
delete reponse->m_cs;
delete reponse;
// sleep(3);
return ResponseString;
}
//bool busy = true;
reponse->m_GData->dcvoldata.b_ae = true;
//,":");
reponse->m_GData->dcvoldata.sae = GetResultValue(pots,"A-GND DC Vol:");
/////////
//pots = "";
///////////////////////////////////////////////
// sleep
Mahmoud_Gamal
13-May-14 16:31pm
View
thanks for replay but this peace of code it run well alone but when i embedded this code in
threading system it case stack over flow or access violation when i call more time i think
due to the large string
Mahmoud_Gamal
12-May-14 5:41am
View
may be right but when i debug it on this string it work well but when i commit in app
may be run and may be not it case stack overflow when i call more times in threads
Mahmoud_Gamal
10-May-14 11:39am
View
OK for example when i call parsing function for first time and second it work correctly but when i call third times it case stack over flow but when i work on high ram it work perfectly
Mahmoud_Gamal
10-May-14 8:21am
View
thanks for replay but i want to send and receive data throw this port or to be more accurate
i want to sniffing data throw this port
Mahmoud_Gamal
7-May-14 9:11am
View
thanks very much for your interesting , thanks alot
Mahmoud_Gamal
7-May-14 9:06am
View
yes it is interactive services :D
Mahmoud_Gamal
7-May-14 8:38am
View
yes i do this and also i pass the full exe path in command line and parameter but don't work it should be work as console application not as windows service
Mahmoud_Gamal
7-May-14 7:36am
View
i want to run exe file from service due to if i restart machine the service automatic run exe file with no need from me to run it
Mahmoud_Gamal
7-May-14 7:34am
View
if i create process like your code is it run or not due to i try this code and no action
Mahmoud_Gamal
7-May-14 7:33am
View
it doesn't run with me , it run only when i run as console application not as windows service
Mahmoud_Gamal
6-May-14 7:44am
View
enta beda
Show More