Results 1 to 2 of 2

Thread: Windows socket error 10057

  1. #1

    Windows socket error 10057

    I search around but i don't find a solution.
    I'm using Tserversocket, i have something like this for receive data:

    [pascal] data: array[0..400] of char;

    procedure TForm1.ServerSocket1ClientRead(Sender: TObject;
    Socket: TCustomWinSocket);
    begin
    datalength:=0;
    ServerSocket1.Socket.ReceiveBuf(Data,datalength);
    End;[/pascal]

    when receiving data i got windows socket error, if i use Socket.ReceiveText instead everything works.
    A client can be of any type/application, server have just to store data received for study it ( inverse engineering )

    i see that the server receive a lot of #0 ( end string ) so is bugged using receiveText.

    any hints?
    Will: "Before you learn how to cook a fish you must first learn how to catch a fish." coolest

  2. #2

    Windows socket error 10057

    I don't know if it'll help but I would write it like this:
    [pascal]
    data: array[0..400] of char;

    procedure TForm1.ServerSocket1ClientRead(Sender: TObject;
    Socket: TCustomWinSocket);
    begin
    datalength:=length(data);
    ServerSocket1.Socket.ReceiveBuf(Data[0],datalength);
    End;[/pascal]
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •