Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ServerSocket Error

Posted on 1999-07-28
7
Medium Priority
?
562 Views
Last Modified: 2010-04-04
what causes the Error when i have my own ServerSocket running and a computer connecting with my computer (using
clientSocket) and when i close the program(the one connected with my computer) with Ctrl+alt+del / end task.
well, in my computer it would receive a socket error. how
can i prevent it? and can you teach me a good way of
programming Client and ServerSocket component...



0
Comment
Question by:ryan_sabarre
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
7 Comments
 
LVL 13

Expert Comment

by:Epsylon
ID: 1391778
Write an OnClientError event handler like this:


procedure TForm1.ServerSocket1ClientError(Sender: TObject;
  Socket: TCustomWinSocket; ErrorEvent: TErrorEvent;
  var ErrorCode: Integer);
begin
  InputMemo.Lines.Add('Error occured: ' + IntToStr(ErrorCode));
  case ErrorEvent of
    eeGeneral:    InputMemo.Lines.Add('General error');
    eeSend:       InputMemo.Lines.Add('Send error');
    eeReceive:    InputMemo.Lines.Add('Receive error');
    eeConnect:    InputMemo.Lines.Add('Connect error');
    eeDisconnect: InputMemo.Lines.Add('Disconnect error');
    eeAccept:     InputMemo.Lines.Add('Accept error');
  end;
  ErrorCode := 0;
end;


Cheers,

Epsylon.
0
 
LVL 13

Accepted Solution

by:
Epsylon earned 200 total points
ID: 1391779
Well, I am sure about that! You have to write an OnClientError event handler. If you drop your email here then I can send you a full demo about client and serversockets. But first tell me your Delphi Version.



The OnClientError event handler should be like this:

procedure TForm1.ServerSocket1ClientError(Sender: TObject;
  Socket: TCustomWinSocket; ErrorEvent: TErrorEvent;
  var ErrorCode: Integer);
begin
  InputMemo.Lines.Add('Error occured: ' + IntToStr(ErrorCode));
  case ErrorEvent of
    eeGeneral:    InputMemo.Lines.Add('General error');
    eeSend:       InputMemo.Lines.Add('Send error');
    eeReceive:    InputMemo.Lines.Add('Receive error');
    eeConnect:    InputMemo.Lines.Add('Connect error');
    eeDisconnect: InputMemo.Lines.Add('Disconnect error');
    eeAccept:     InputMemo.Lines.Add('Accept error');
  end;
  ErrorCode := 0;
end;


Cheers,

Epsylon.       epsylon3@hotmail.com
0
 
LVL 1

Expert Comment

by:pede
ID: 1391780
Epsylon: I would like a copy of the demo, if you don't mind. Using Delphi 4.

pe@des.dk

/Pede


0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 13

Expert Comment

by:Epsylon
ID: 1391781
Pede, I send as soon as Ryan responds....
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1391782
ryan_sabarre, are you going to do something?
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1391783
Hello?
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6872353
GREETINGS!

This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.

http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
http://www.experts-exchange.com/jsp/zonesAll.jsp
 
Thank you,
Moondancer
Moderator @ Experts Exchange
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question