#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2004
    Posts
    24
    Rep Power
    0

    strings sending/receiving


    hi!
    this is my procedure:
    procedure TfrmMain.ServerSocketClientRead(Sender: TObject;
    Socket: TCustomWinSocket);
    var
    sIn : string;
    buf : string;
    begin
    sIn := Socket.ReceiveText;
    AddLog('Leggi in: ' + sIn);
    // Forward it onward
    sockForward.Socket.SendText(sIn);
    buf := sockForward.Socket.ReceiveText;
    ServerSocket.Socket.SendText(buf);
    end;

    I get the error:"a request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied (10057) with the Api 'send'"
    why???
    can you help me?? thank you!! Christian
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,640
    Rep Power
    4247
    I bet you haven't connected sockForward to the other end. Seriously though, let me give you a good solid piece of advice -- there is a very good debugger that comes integrated with Delphi, learn to use it. It will show you exactly which line is giving you the error message. Posting a code snippet here is no use, if you won't tell us where you suspect the problem is. Either post the full code or at least try to narrow down the problem to within a line or two.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo

IMN logo majestic logo threadwatch logo seochat tools logo