Results 1 to 4 of 4

Thread: Simba Sockets Help..

  1. #1
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default Simba Sockets Help..

    Ok.. so I'm trying to create a server and a client in Simba. I've done it in other languages but I wanted to make a sockets tutorial in Simba by showing how to make a chat client such as MSN for example. Unfortunately, I can't even get the basic setup working in Simba..

    For some reason, it refuses to connect to even localhost :S I even tried legit addresses/ports instead of special addresses like: INADDR_ANY for the server..

    Can someone tell me why it does this? I can download pages using sockets but can't connect to localhost or anything else other than websites? Also, how can I make it Async? Oh and does Simba Sockets support SSL/TLS?

    Simba Code:
    procedure Connect(var Socket: Integer; Port, Address: String; Listen: Boolean);
    begin
      Socket := CreateSocket;
      if (Socket <> 0) then
      begin
        writeln('Failed To Initialize Socket');
        terminatescript;
      end;

      ConnectSocket(Socket, Address, Port);

      if (Listen) Then
      Begin
        BindSocket(Socket, Address, Port);
        ListenSocket(Socket);
      End;
    end;


    var
      ClientSocket, ServerSocket: Integer;
    begin
      Connect(ServerSocket, '587', '127.0.0.1', true);
      writeln(AcceptSocket(ServerSocket));
      CloseSocket(ServerSocket);
      FreeSocket(ServerSocket);
    end.
    I am Ggzz..
    Hackintosher

  2. #2
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Hmm I also wrote one of those a while back.. They work but this thing does not :l Meh.. it's ok I guess.. Simba's sockets are too limited.
    I am Ggzz..
    Hackintosher

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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