Page 2 of 5 FirstFirst 1234 ... LastLast
Results 26 to 50 of 106

Thread: ProSocks

  1. #26
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    I hate to always be the bearer of bad news :X ..

    But the Email Function somtetimes get stuck here:
    220 mx.google.com ESMTP w12sm112009888eez.36 - gsmtp
    250 mx.google.com at your service
    334 VXNlcm5hbWU6
    334 UGFzc3dvcmQ6
    235 2.7.0 Accepted
    ... (not doing anything now).

    What is the timeout ?

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

    Default

    Quote Originally Posted by caused View Post
    I hate to always be the bearer of bad news :X ..

    But the Email Function somtetimes get stuck here:
    220 mx.google.com ESMTP w12sm112009888eez.36 - gsmtp
    250 mx.google.com at your service
    334 VXNlcm5hbWU6
    334 UGFzc3dvcmQ6
    235 2.7.0 Accepted
    ... (not doing anything now).

    What is the timeout ?

    Timeout is default timeout. I didn't change it. I'm upgrading the library module atm. Gimmie a couple mins to change some things then I'll look into it. I'm making it support IPV4 and IPV6. Making a options function to set timeouts and non-blocking modes, etc..
    I am Ggzz..
    Hackintosher

  3. #28
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Sounds great .

    Really love your plugins

  4. #29
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    @Brandon; can this view github pages?

  5. #30
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Quote Originally Posted by Robert View Post
    @Brandon; can this view github pages?
    http://villavu.com/forum/showthread....03#post1292303

  6. #31
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    hellllllllllllllllllllllllllllllllllllllllllllllll lllllll yea

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

    Default

    <3 Thanks for covering me while I'm away and what not. Basically thanks for the helpful support.

    Quote Originally Posted by Robert View Post
    hellllllllllllllllllllllllllllllllllllllllllllllll lllllll yea
    LOL you're a bit too happy there ahaha.

    Yeah it does as Olly showed. I haven't had time to compile the new update yet (https://github.com/Brandon-T/ProSocks). The code is on github. It just needs compiling. Works with both C and C++ compilers.

    Been developing for an iOS (Objective-C) company and other companies and it's been taking up ALL my free time. Hopefully no bugs in the current plugin.
    I am Ggzz..
    Hackintosher

  8. #33
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Raw github works for me though in Simba


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

    Default

    Quote Originally Posted by Olly View Post
    Raw github works for me though in Simba


    How'd you do that? Have SSL installed in Plugins folder?
    I am Ggzz..
    Hackintosher

  10. #35
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    How'd you do that? Have SSL installed in Plugins folder?
    Nope, nothing special just the default SRL plugins. I just went and tested it.

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

    Default

    Quote Originally Posted by Olly View Post
    Nope, nothing special just the default SRL plugins. I just went and tested it.

    You're right.. That does indeed work.. but still no secure connection..


    Simba Code:
    var
      Sock: Integer;

      Address: String;
      Username: String;
      Password: String;
      Receiver: String;
      FromName: String;
      ToName: String;
      Subject: String;
      Message: String;
    begin
      //This line below works..
      writeln(GetPage('https://raw.githubusercontent.com/Brandon-T/ProSocks/master/README.md'));


      Address := 'smtp.gmail.com';
      Username := 'ICantChooseUsernames@gmail.com';
      Password := '****Password****';
      Receiver := 'ICantChooseUsernames@gmail.com';
      FromName := 'Brandon';
      ToName := 'Brandon';
      Subject := 'Test mail';
      Message := 'Hello there..';




      Sock := CreateSocket;
      ConnectSocket(Sock, Address, '465'); //Can't connect to SSL port. Port 25 will give a response but 465 will disconnect.
      SetSocketTimeout(Sock, 2500);



      //------------------------------------------------------

      SendSocket(Sock, 'EHLO ' + Address + #13#10);
      writeln(RecvSocket(Sock)); //Will crash here with error 10054  http://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx

      SendSocket(Sock, 'AUTH LOGIN' + #13#10);
      writeln(RecvSocket(Sock));

      SendSocket(Sock, Base64Encode(Username) + #13#10);
      writeln(RecvSocket(Sock));

      SendSocket(Sock, Base64Encode(Password) + #13#10);
      writeln(RecvSocket(Sock));

      SendSocket(Sock, 'MAIL FROM: <' + Username + '>' + #13#10);
      writeln(RecvSocket(Sock));

      SendSocket(Sock, 'VRFY ' + Username + #13#10);
      writeln(RecvSocket(Sock));

      SendSocket(Sock, 'RCPT TO: <' + Receiver + '>' + #13#10);
      writeln(RecvSocket(Sock));

      SendSocket(Sock, 'DATA' + #13#10);
      writeln(RecvSocket(Sock));

      SendSocket(Sock, 'From: ' + FromName + '<' + Username + '>' + #13#10);
      SendSocket(Sock, 'To: ' + ToName + '<' + Receiver + '>' + #13#10);
      SendSocket(Sock, 'Subject: ' + Subject + #13#10#13#10);
      SendSocket(Sock, Message + #13#10 + '.' + #13#10);
      writeln(RecvSocket(Sock));

      SendSocket(Sock, 'QUIT' + #13#10);
      writeln(RecvSocket(Sock));




      CloseSocket(Sock);
      FreeSocket(Sock);
    end.
    Last edited by Brandon; 05-01-2014 at 12:50 AM.
    I am Ggzz..
    Hackintosher

  12. #37
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Uhh weird bug here:

    Simba Code:
    {$I Socks.Simba}

    var
      HT: HTTPS;
    begin
      HT.Create('https://raw.githubusercontent.com/officerBarbrady/SSInclude/master/Soulsplit/core/tfile.simba', 443);
      writeln(HT.GetPage); //download a page. Do NOT have to only download pages.
      HT.Free;
    end.

    For some reason it does not get the top part of the file:

    Simba Code:
    type
      TFile = record
        path, name, extension, data, realPath:string;
      end;

    This is the version it gets:

    Simba Code:
    function TFile.exists():boolean;
    var
      s:TStringArray;
      i:Integer;
    begin
      s := GetFiles(self.path, self.extension);
      for i := 0 to high(s) do
        if (s[i] = (self.name +'.' + self.extension)) then
          exit(true);
    end;

    procedure TFile.recall(const filePath, fileName, fileExtension:string);
    begin
      self.path := path;
      self.name := name;
      self.extension := fileExtension;
      self.realPath := filePath + fileName + '.' + fileExtension;
    end;

    function newFile(const filePath, fileName, fileExtension:string):TFile;
    begin
      result.path := filePath;
      result.name := fileName;
      result.extension := fileExtension;
      result.realPath := filePath + fileName + '.' + fileExtension;
    end;

    function TFile.open():integer;
    begin
      result := openFile(self.realPath, true);
    end;

    function TFile.getSize():integer;
    var
      tmpFile:integer;
    begin
      try
        tmpFile := self.open();
        result := fileSize(tmpFile);
        closeFile(tmpFile);
      except
      end;
    end;

    function TFile.readString(const strLength:integer):string;
    var
      tmpFile:integer;
      str:string;
    begin
      if (not self.exists()) then
        exit('');
      try
        tmpFile := self.open();
        ReadFileString(tmpFile, str, strLength);
        closeFile(tmpFile);
      except
      finally
        result := str;
      end;
    end;

    function TFile.readString():string; overload;
    begin
      result := self.readString(self.getSize());
    end;

    function TFile.rewrite():integer;
    begin
      try
        result := rewriteFile(self.realPath, true);
      except
      end;
    end;

    function TFile.setText(const str:string):boolean;
    var
      tmpFile:integer;
    begin
      if (not self.exists()) then
        exit();
      try
        tmpFile := self.rewrite();
        writeFileString(tmpFile, str);
        closeFile(tmpFile);
      except
      end;
    end;

    function TFile.parseData(const str1, str2:string):string;
    var
      str:string;
    begin
      result := between(str1, str2, self.readString());
    end;

    function TFile.delete():boolean;
    begin
      result := deleteFile(self.realPath);
    end;

    procedure TFile.create(const filePath, fileName, fileExtension, writeData:string;overwrite:boolean);
    var
      tmpFile:integer;
    begin
      if (not overwrite) and (self.exists()) then
      begin
        self.recall(filePath, fileName, fileExtension);
        exit();
      end;
      try
        self.path := filePath;
        self.name := fileName;
        self.extension := fileExtension;
        self.realPath := filePath + fileName + '.' + fileExtension;
        tmpFile := createFile(self.realPath);
        closeFile(tmpFile);
        if self.setText(writeData) then
          self.data := writeData;
      except
      end;
    end;

    procedure TFile.create(const thePath, writeData, fileExtension, thename:string); overload;
    var
      tmpFile:integer;
    begin
      try
        self.realPath := thePath;
        self.name := theName;
        self.extension := fileExtension;
        tmpFile := createFile(thePath);
        closeFile(tmpFile);
        if self.setText(writeData) then
          self.data := writeData;
      except
      end;
    end;

    The type is missing
    Thus creating an error in my include :S


    Added a extra line and that somehow fixed it -.-

  13. #38
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    Try using GetRawPage instead and see if it makes a difference. If it does, then I need to fix my header parser.
    Just used it, it jumbles up a few words. Also the getPage is now cutting off the type again :/

    @Brandon;

    I replaced the function in the include with you one you posted,

    Now I get this in my inventory.simba (downloads interface.simba somehow and other stuff) (it also adds all that stuff in other files and mismatched all of them)

    Code:
    HTTP/1.1 200 OK
    Date: Thu, 01 May 2014 19:42:46 GMT
    Server: Apache
    Content-Security-Policy: default-src 'none'
    Access-Control-Allow-Origin: https://render.githubusercontent.com
    X-XSS-Protection: 1; mode=block
    X-Frame-Options: deny
    X-Content-Type-Options: nosniff
    Strict-Transport-Security: max-age=31536000
    ETag: "148d7ce6046517d98a2d6666081921d5a3816b4b"
    Content-Type: text/plain; charset=utf-8
    Cache-Control: max-age=300
    Content-Length: 13585
    Accept-Ranges: bytes
    Via: 1.1 varnish
    X-Served-By: cache-at51-ATL
    X-Cache: MISS
    X-Cache-Hits: 0
    Vary: Authorization,Accept-Encoding
    Expires: Thu, 01 May 2014 19:47:46 GMT
    Source-Age: 0
    Connection: close
    
    length(self.getTPA()) > 1000);
    end;
    
    (*
      Author: Officer Barbrady
      Description: Gets name of interface
    *)
    
    function ssInterface.getName:string;
    var
      b:TBox;
    begin
      if (not self.isOpen()) then
        exit;
      b := self.getBounds();
      b.y2 := b.y1 + 40;
      result := getSimpleText([2070783, 37375, 65535], b.x1, b.y1, b.x2, b.y2, 'upchars07');
    end;
    
    (*
      Author: Officer Barbrady
      Description: Gets interface description
    *)
    
    function ssInterface.getDescription:string;
    var
      b:TBox;
    begin
      if (not self.isOpen()) then
        exit;
      b := self.getBounds();
      b.y1 := b.y1 + 80;
      result := getSimpleText([2070783], b.x1, b.y1, b.x2, b.y2, 'smallchars07');
    end;
    
    (*
      Author: Officer Barbrady
      Description: Closes interface
    *)
    
    procedure ssInterface.close;
    var
      b:TBox;
      text:string;
    begin
      if (not self.isOpen()) then
        exit;
      b := self.getBounds();
      mouse(b.x2 - 15, b.y1 + 30);
    end;

  14. #39
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    @Brandon;

    Simba Code:
    procedure TUpdateSystem.update;
    var
      i, c:integer;
      f:TFile;
      p:string;
      gitPage: HTTPS;
    begin
      writeln('Scanning for files to update..');
      for i := 0 to high(self) do
      begin
        gitPage.Create(self[i].link, 443);
        writeln(self[i].link);
        p := gitPage.GetPage();
        gitPage.free();
        if (length(p) <> length(self[i].sourceFile.readString())) then
        begin
          writeln('Updated file ' , self[i].sourceFile.realPath);
          if f.create(self[i].sourceFile.Path, self[i].sourceFile.name, 'simba', p, true) then
            c := c + 1
          else
            writeln('Failed to updated file ' , self[i].sourceFile.path , self[i].sourceFile.name , '.simba');
        end;
      end;
      writeln('Finished updating ' , c, ' files');
    end;

    Does it have something to do with the fact that I use the same type each of the 28 times?







    Used array of https works fine now woot


    Never mind again, it's merging text.simba with part of prayer.simba

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

    Default

    Quote Originally Posted by Robert View Post

    Never mind again, it's merging text.simba with part of prayer.simba

    Try the OP again. I just updated the include (not the plugin). Noticed it was doing the same thing. Your file has nulls written into it OR the server is limiting how much can be read at once. Had to write a MemSet function to reset the buffer too. Simba's string length is USELESS.. As soon as it hits a null, it stops printing regardless of the length of the string. Had to trim each buffer.


    Example:

    String 'Buffer' has contents: 'hello there #0 brave #0 new #0 world'

    The value of Length(Buffer) is: 36.
    If you writeln(Buffer), it prints only 'hello there '. It stops at the first null. Anyway, all should be fixed.

    I did:
    Simba Code:
    HT.Create('https://raw.githubusercontent.com/officerBarbrady/SSInclude/master/Soulsplit/core/prayer.simba', 443);

      writeln(HT.GetPage);

      HT.Free;
    Last edited by Brandon; 05-01-2014 at 09:19 PM.
    I am Ggzz..
    Hackintosher

  16. #41
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    Try the OP again. I just updated the include (not the plugin). Noticed it was doing the same thing. Your file has nulls written into it OR the server is limiting how much can be read at once. Had to write a MemSet function to reset the buffer too. Simba's string length is USELESS.. As soon as it hits a null, it stops printing regardless of the length of the string. Had to trim each buffer.


    Example:

    String 'Buffer' has contents: 'hello there #0 brave #0 new #0 world'

    The value of Length(Buffer) is: 36.
    If you writeln(Buffer) it, it prints only 'hello there '. Stops at the first null.
    Do you think that has something to do with some random spacing issues lol:

    Code:
    Exception in Script: Unknown declaration "elseiButton" at line 171, column 7 in file "C:\Simba\Includes\Soulsplit\core\mouse.simba"
    Exception in Script: Unknown declaration "tpa" at line 101, column 45 in file "C:\Simba\Includes\soulsplit\misc\simba.simba"
    Exception in Script: Unknown declaration "doresult" at line 105, column 27 in file "C:\Simba\Includes\soulsplit\misc\datatypes\string.simba"
    Exception in Script: Unknown declaration "doresult" at line 105, column 27 in file "C:\Simba\Includes\soulsplit\misc\datatypes\string.simba"
    Exception in Script: Unknown declaration "dofor" at line 154, column 25 in file "C:\Simba\Includes\soulsplit\misc\datatypes\string.simba"
    Exception in Script: Unknown declaration "exceptresult" at line 84, column 3 in file "C:\Simba\Includes\Soulsplit\core\text.simba"
    Randomly glues some words together

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

    Default

    @Robert;


    It works perfectly fine.. Has to be something you are doing incorrectly.

    Simba Code:
    {$I Socks.Simba}

    const
      URL = 'https://raw.githubusercontent.com/officerBarbrady/SSInclude/master/Soulsplit';

      MainFiles = ['Files.txt', 'Soulsplit.simba', 'Updater.simba'];

      CoreFiles = ['bank', 'chatbox', 'dtm', 'gametab', 'globals', 'interface', 'inventory',
                   'login', 'mainscreen', 'math', 'minimap', 'mouse', 'prayer', 'tDirectory',
                   'text', 'tfile', 'timing'];

      MiscFiles = ['Simba', 'debug'];

      MiscDataTypeFiles = ['extended', 'extendedarrays', 'integer', 'integerarrays', 'string',
                           'stringarrays', 't2dstringarray', 'tbox', 'tpoint', 'tpointarrays', 'typemath', 'types'];


      Directories = ['C:/Simba/Includes/SoulSplit', '/core', '/misc', '/misc/datatypes'];


    Function WriteFile(Path: String; Buffer: String): Boolean;
    var
      hFile: Integer;
    Begin
      hFile := RewriteFile(Path, false);
      if (hFile > -1) then
      begin
        WriteFileString(hFile, Buffer);
        CloseFile(hFile);
      end;
    End;

    Function GetSoulsplit: Boolean;
    var
      I: Integer;
      HT: Array Of HTTPS;
    Begin
      CreateDirectory(Directories[0]);
      CreateDirectory(Directories[0] + Directories[1]);
      CreateDirectory(Directories[0] + Directories[2]);
      CreateDirectory(Directories[0] + Directories[3]);


      SetLength(HT, Length(MainFiles));
      For I := 0 To High(MainFiles) Do
      Begin
        HT[i].Create(URL + '/' + MainFiles[i], 443);
        WriteFile(Directories[0] + '/' + MainFiles[i], HT[i].GetPage);
        HT[i].Free;
      End;

      SetLength(HT, 0);
      SetLength(HT, Length(CoreFiles));
      For I := 0 To High(CoreFiles) Do
      Begin
        HT[i].Create(URL + '/core/' + CoreFiles[i] + '.simba', 443);
        WriteFile(Directories[0] + Directories[1] + '/' + CoreFiles[i] + '.simba', HT[i].GetPage);
        HT[i].Free;
      End;

      SetLength(HT, 0);
      SetLength(HT, Length(MiscFiles));
      For I := 0 To High(MiscFiles) Do
      Begin
        HT[i].Create(URL + '/misc/' + MiscFiles[i] + '.simba', 443);
        WriteFile(Directories[0] + Directories[2] + '/' + MiscFiles[i] + '.simba', HT[i].GetPage);
        HT[i].Free;
      End;

      SetLength(HT, 0);
      SetLength(HT, Length(MiscDataTypeFiles));
      For I := 0 To High(MiscDataTypeFiles) Do
      Begin
        HT[i].Create(URL + '/misc/datatypes/' + MiscDataTypeFiles[i] + '.simba', 443);
        WriteFile(Directories[0] + Directories[3] + '/' + MiscDataTypeFiles[i] + '.simba', HT[i].GetPage);
        HT[i].Free;
      End;
    End;

    begin
      GetSoulsplit;
    end.


    It would of course be best if Simba had a way of unzipping zip files. That way you simply download the zip and decompress it rather than each file one by one.


    Now for resource intense applications, you can use one socket and just reset the headers every time.
    Last edited by Brandon; 05-02-2014 at 01:17 AM.
    I am Ggzz..
    Hackintosher

  18. #43
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    @Brandon; it still mismatches the same things :/

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

    Default

    Quote Originally Posted by Robert View Post
    @Brandon; it still mismatches the same things :/
    Last time.. Try the post on the OP now. I only updated the include.. God sometimes I just wish Simba would play nicely with C-strings..


    I had to replace (the first workaround):

    Simba Code:
    Result := Result + Trim(Buffer); //would replace spaces too ={

    with (the second workaround)

    Simba Code:
    Result := Trim(Replace(Result, #0, '', [rfReplaceAll])); //replace NULL chars in strings. Trim only the edges.

    again due to the bug mentioned in my previous post.. It should without a doubt work now. I actually tested it extensively this time AND I ran your include -_-

    Hopefully I don't need a third..


    It's starting to bother me that strings in Simba have lengths that mean nothing.. Anyway, test it and let me know how it goes.
    Last edited by Brandon; 05-02-2014 at 01:23 AM.
    I am Ggzz..
    Hackintosher

  20. #45
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    Last time.. Try the post on the OP now. I only updated the include.. God sometimes I just wish Simba would play nicely with C-strings..


    I had to replace (the first workaround):

    Simba Code:
    Result := Result + Trim(Buffer); //would replace spaces too ={

    with (the second workaround)

    Simba Code:
    Result := Trim(Replace(Result, #0, '', [rfReplaceAll])); //replace NULL chars in strings. Trim only the edges.

    again due to the bug mentioned in my previous post.. It should without a doubt work now. I actually tested it extensively this time AND I ran your include -_-

    Hopefully I don't need a third..


    It's starting to bother me that strings in Simba have lengths that mean nothing.. Anyway, test it and let me know how it goes.
    Woot woot works now and compiles thanks a ton!

  21. #46
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    It would of course be best if Simba had a way of unzipping zip files. That way you simply download the zip and decompress it rather than each file one by one.
    https://github.com/MerlijnWajer/Simba/pull/266


  22. #47
    Join Date
    Jul 2009
    Posts
    166
    Mentioned
    5 Post(s)
    Quoted
    69 Post(s)

    Default

    Code:
    {{$I Socks.Simba}
    
    var
    recv:String;
    info:SSLSocket;
    
    procedure Connect(Address: String;Port:Integer);
     begin
      info.port := Port;
      info.address := @Address[1];
      info.socktype := SSLSocketType.SSL23_SERVER_METHOD;
    
      Pro_CreateSocket(@info);
      Pro_ConnectSocket(@info);
      writeln(info);
    end;
    
    
    procedure Read(Address: String;Port:Integer);
    begin
      info.port := Port;
      info.address := @Address[1];
      info.socktype := SSLSocketType.SSL23_CLIENT_METHOD;
    
      Pro_ReadSocket(@info, @recv, 512);
    end;
    
    
    procedure Destroy(Address: String;Port:Integer);
    begin
      info.port := Port;
      info.address := @Address[1];
      info.socktype := SSLSocketType.SSL23_SERVER_METHOD;
    
      Pro_FreeSocket(@info);
      end;
    
    
     begin
     Connect('localhost',80);
     repeat
      Wait(500);
      Read('localhost',80);
       writeln(recv);
     until(false);
     Destroy('localhost',80);
     end.
    Hi it's me again.
    I am trying to make local port and listen to that port constantly.
    But it crashes before reading anything.
    Help.
    Last edited by alar82; 05-12-2014 at 01:20 PM.

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

    Default

    Quote Originally Posted by alar82 View Post
    Hi it's me again.
    I am trying to make local port and listen to that port constantly.
    But it crashes before reading anything.
    Help.
    Hello. You have a couple things you shouldn't do because it makes NO difference at all.. Your code is equivalent to:

    Simba Code:
    {$I Socks.Simba}

    var
    recv:String;
    info:SSLSocket;

    procedure Connect(Address: String;Port:Integer);
     begin
      info.port := Port;
      info.address := @Address[1];
      info.socktype := SSLSocketType.SSL23_SERVER_METHOD;

      Pro_CreateSocket(@info);
      Pro_ConnectSocket(@info);
      writeln(info);
    end;


    procedure Read();
    begin
      Pro_ReadSocket(@info, @recv, 512);
    end;


    procedure Destroy();
    begin
      Pro_FreeSocket(@info);
    end;


     begin
     Connect('localhost',80);
     repeat
      Wait(500);
      Read();
       writeln(recv);
     until(false);
     Destroy();
     end.

    Secondly, I cannnot replicate the crash. It is actually working. Where exactly are you getting a crash? The socket on the OP is a blocking socket. If there is nothing to read, it is going to WAIT until there is something to read. So if you are trying to do anything on that Simba that is waiting, it is going to crash because it cannot handle messages while the socket is blocking.

    I have non-blocking and async sockets already made. I just need to compile them.. I'll upload it later. It is written in C and the source is at: https://github.com/Brandon-T/ProSocks

    You may compile it if you wish or wait until I update the simba include to use it.


    That all being said, I cannot replicate any crashing.. Anyone else?
    I am Ggzz..
    Hackintosher

  24. #49
    Join Date
    Jul 2009
    Posts
    166
    Mentioned
    5 Post(s)
    Quoted
    69 Post(s)

    Default

    Hey even my fabulous code works now.
    When stick before readsocket this:
    Code:
    Pro_WriteSocket(@info, 'ppyy', 4);
    Nothing pops up at debug, soso what now?

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

    Default

    Quote Originally Posted by alar82 View Post
    Hey even my fabulous code works now.
    When stick before readsocket this:
    Code:
    Pro_WriteSocket(@info, 'ppyy', 4);
    Nothing pops up at debug, soso what now?

    You cannot write to your own socket and expect to read back the same values you wrote.. It doesn't work like that. Sockets act like pipes for example:


    One is the pipe where you read from and one you write to.

    See:





    In other words, open a new tab, create a socket that listens to that port and address constantly; and prints it..
    Open another tab and create a socket that writes to that port and address constantly.

    It will work then.. Otherwise, you're using sockets for all the wrong reasons.. You need a "server" that listens for requests and writes responses.. You need a "client" that writes requests and listens for responses.

    This is the entire concept behind sockets. One tab is your server, the other tab is your client. It can also be: one simba is your server, one simba is your client. In the case of emails, you are the client, gmail is the server.
    Last edited by Brandon; 05-12-2014 at 06:11 PM.
    I am Ggzz..
    Hackintosher

Page 2 of 5 FirstFirst 1234 ... LastLast

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
  •