How to work with sockets

  • lenti001
  • Topic Author
  • Offline
  • New Member
  • New Member
More
17 years 5 months ago #2054 by lenti001
How to work with sockets was created by lenti001

Hello,

Is it possible to work with sockets with subroutine?

For example: I want to send a stream('Hello World') in specific port on a specific IP address.

Detailed example would be very appreciated.

Regards,

Please Log in or Create an account to join the conversation.

More
17 years 4 months ago #2055 by malai
Replied by malai on topic Use Java or C or Cplusplus
I dont think jBASE has any methods for creating Sockets. Write your socket programming in Java, C or C++ and call it from jBASE.

___________

Thanks

Please Log in or Create an account to join the conversation.

  • lenti001
  • Topic Author
  • Offline
  • New Member
  • New Member
More
17 years 4 months ago #2056 by lenti001
Replied by lenti001 on topic how to wok with sockets?
Thanks for your reply.

I am familliar with java but i am not familliar with InfoBasic :)



Lets say that i have this program in Java



public class HelloWorld(){

public String getResponse(String request){

if (request.equals('Test')) return 'Cangratulation. You typed Test';

else return 'You failed!';

}

}



Now if i want to use method getResponse from this program here is what i do in java



HelloWorld myProg = new HelloWorld();

String response1 myProg.getResponse('Test');

String response2 myProg.getResponse('Test1');



I would really appreciate if you brifely describe how can i do this in infobasic subroutine (bold lines)



Thanks,

Please Log in or Create an account to join the conversation.

More
13 years 9 months ago - 13 years 9 months ago #8925 by saahmad
Replied by saahmad on topic Re: How to work with sockets
Create java class that do the communications and call this class from infobasic using CALLJ interface. Usually from CALLJ these are just two or three lines of code to call java classes. actual working is of the java class.
CALLJ takes classname, method name and any additional params for the java class. It out puts the Return variable in the java class. also gives an error code
Last edit: 13 years 9 months ago by saahmad.

Please Log in or Create an account to join the conversation.

Time to create page: 0.034 seconds