Are there semantically identical alternatives for getaddrinfo on Win8 Metro? - microsoft-metro

I am trying to port an existing, large-scale, multi-platform library to Win8 Metro, but got blocked by some removed APIs. Browsing the documentation and looking into some code samples did not help, I still cannot find a simple, reliable alternative for the missing GetAddrInfoW and getaddrinfo functions. Can anyone tell, what the proposed alternative is for these removed functions? AM I just overlooking something in the docs? Thank You,
György

Are you sure, that those functions really do not exist anymore? The winsock docs specifically mention that GetAddrInfoW was actually extended in Windows 8 Consumer Preview, and not removed.
Quote: "On Windows 8 Consumer Preview and Windows Server 8 Beta, the GetAddrInfoW function provides support for IRI or Internationalized Domain Name (IDN) parsing applied to the name passed in the pNodeName parameter. Winsock performs Punycode/IDN encoding and conversion. This behavior can be disabled using the AI_DISABLE_IDN_ENCODING flag discussed below."
Edit: Looking at it again it says at the top of the document that it only applies to desktop applications. For Metro Apps winsock2 seems to be unavailable and without an equivalent alternative for those two functions. At least i couldn't find one.

Related

Flutter and IBM as400

a particular question: is there a direct way to make an AS400 connection or do you have to go through PHP? I don't have to read data on DB2, but do the various commands (wrkactjob, wrksyssts, etc.). Thank you.... sorry for the English.
what I thought (maybe it can't be done) is this: in the app screen there are buttons, each button executes a command (wrkactjob, clroutq, etc.) and the answer occurs in another screen ... I didn't want to write commands directly like on 5250 or telnet
From your referral to typical "health checking" programs, like wrkactjob, and wrksyssts I guess your primary goal is to have an application running on your Android based phone to quickly check the status of a machine from wherever you are. Correct?
Have you considered how to get access to the machine's IP address when you're on the road and not connected to the local WiFi?
You can access this "performance data" through SQL — as John Y pointed out — and display it in whatever for is convenient on your mobile device. But I highly doubt Android provides ODBC infrastructure, even though you might manage to get the correct binary blobs (CPU wise) of the ODBC drivers from IBM botched into Android.
Otherwise you want to create a mechanism to scrape the screen for whatever is displayed, and translate that textual representation into UI elements provided by Flutter, if you want UI elements instead of textual output.
If you already have your doubts that you can't do telnet with Flutter, I think you'll have to learn a lot about Flutter as an SDK before even thinking about how to start developing an application. TCP/IP networking services are a function of the underlying OS and you'll have to go through all the Flutter abstraction layers to eventually be able to build a TCP session. With some luck, there is already code available to handle the telnet protocol peculiarities for you. Perhaps not, then you need to provide telnet negotiation and protocol yourself. This is documented in numerous RFCs. Use Google yourself.
Next point is: You need to establish translation routines for conversion of EBCDIC charset data into ASCII. Because Android is Linux based, you need to learn how to call libc routines like iconv() through Flutter, providing a C interface for charset conversion, including EBCDIC flavors as source/target.
Final point: You need to learn how to interpret the 5250 data stream, and translate the terminal emulator instructions into dynamically place Flutter UI elements at appropriate positions on screen. And of course you need to understand what to send back to IBM i to make it understand your request. The tn5250 data stream is also documented in publicly available RFCs.
There once was a facility called Workstation Gateway in the OS, but as I've found out, it has been removed in V5R2. This might have provided an easier means, because the 5250 data stream was converted on the fly to plain HTML.
Now it's your turn to decide if your goal is worth the apparent effort you're required to go through.
I am not sure what you mean by "direct". Do you mean doing your own socket programming? You could, but there are easier ways to connect.
The most obvious and straightforward choices are probably ODBC, JDBC, HTTP, and SSH.
ODBC and JDBC of course provide an SQL-based interface, and you can use that to issue commands (via the QCMDEXC procedure or scalar function) or access an increasingly comprehensive array of IBM i services.
If what you need still isn't available via SQL, or you simply don't like working in SQL, you could make use of the XMLSERVICE library, which provides its own programming interface "on top of" any of the connection types mentioned above. Despite all the instructions for building from source, normally this should already be installed on your IBM i. There are higher-level wrappers for XMLSERVICE in several programming languages (.NET, Node.js, PHP, Python, Ruby, and Swift), but as of this writing, not Dart. I am not familiar with Flutter, but I imagine you could use the JavaScript interop package to work with the Node.js wrapper.

Using agsXMPP in Metro-style applications

I was trying to use agsXMPP reference in a Metro-style app for Windows 8 but I'm getting this error:
Cannot find type System.Collections.CollectionBase in module mscorlib.dll
I think I need the whole .NET for using agsXMPP and Metro does not have the whole. What can I do? Is there any way to use agsXMPP in Metro?
I would suggest investigating Matrix for WinRT (Metro) which is the successor to agsXMPP. While it's not free, it's supported (or soon will be).
According to their forum, they're working on making Matrix work for Metro/WinRT. Given that their comment suggests that they're needing to rewrite lots of code, it's doubtful that agsXMPP will be easily ported.

Using WebSockets in Objective-C

I have tried, unsuccessfully, to use websockets in objective-c with the following two libraries:
http://code.google.com/p/unitt/wiki/UnittWebSocketClient
https://github.com/zootreeves/iOS-WebSockets
In both cases I was unable to establish even a basic connection to a server (runnning on localhost). I was wondering if someone could please provide or point me in the direction of some code that will just simply connect to a server via a websocket and/or perform a handshake.
Ideally, it would be nice if the code could use one of the above libraries, but at this point I'm open to anything that'd work.
I've posted about some issues with UnitT beore but I haven't received any feedback so I'm not sure exactly what step I'm messing up on. Appreciate any help, thanks!
We just released SocketRocket. It supports the latest standard, RFC 6455, which neither ZTWebSocket, nor Unitt does. No CocoaAsyncSocket needed to boot.
Also, libPusher is experimenting with SocketRocket too.
The libPusher library uses the ZTWebSocket object. And we have a number of clients who've developed iOS applications against our service. So, the ZTWebSocket object works and should be a good starting point. The libPusher library would be a good reference for usage.
The key to making UnitT work is to find out what version of the specification is your server running. Then you use the correct version for the client. The latest (rev17) of the specification FINALLY allows for multiple versions and having the server send back an appropriate response, but none of the prior versions do. Therefore, you may not receive a meaningful error from the server, just a disconnection. Do you know what version your server is running?

Call REST Webservice from Blackberry

I am new to Blackberry app development. I need to call REST webservice from blackberry application using JDE 4.7. I searched but not got any solution. Anyone help pls?
sri
You have to make an HttpConnection request and read the data as an InputStream... have a look at this tutorial Calling REST based web services
I appreciate this an old post - but it has been updated so someone is looking at it, so I thought it appropriate to contribute.
I am sorry, but I can not recommend the code supplied the link from another answer called "Calling REST based web services".
I have made a comment explaining this on the site, along the following lines:
"In my opinion this code is flawed because it does not consider the different connection methods, nor does it consider different encodings. More over it does not consider the Event Thread or provide reasonable error checking and logging. I appreciate that this is just a sample, but I think the author has a responsibility to make people who might use this code aware of how it should be used properly. And this code will cause more problems that it solves. Refer to the supported BlackBerry documentation and web sites for better samples."
Sorry, I am not as familiar as I should be of the questions asked on stackoverflow, but questions like this come up regularly on the BBRY forum here:
http://supportforums.blackberry.com/t5/Java-Development/bd-p/java_dev
I recommend that you go on that forum and type network in the Search box on that site and you be presented with a range of tutorials and KB articles that discuss all aspects of networking. In this particular case I would recommend this:
http://supportforums.blackberry.com/t5/Java-Development/What-Is-Network-API-alternative-for-legacy-OS/ta-p/614822
Networking is not trivial on the BlackBerry, do not expect a cut and paste of the code supplied to work for you. Specifically you should be aware of:
a) The various connection methods, the costs associated with each and the impact that using each might have (e.g. transcoders or caching)
b) The Event Thread, how to get off it and back on when processing a response
c) Logging and reporting so that you can investigate problems when they occur (and they will).
Personally, given that all OS 4.7 devices can be upgraded to OS 5.0 and should be, since OS 5.0 is better, I would forget supporting OS 4.7. Instead look at OS 5.0 and above support and use ConnectionFactory.

Handling Custom Protocols

I'm looking to respond to an event from a web browser, hopefully any web browser. I'm working solely on windows and I came to the conclusion a custom protocol (I.E. myprot://collection/of/strings) is the best approach here (any objections?). But, handling an instance of this protocol seems to be a little less straight-forward. All I need is that collection of strings auto-magically passed to my already running application! (the app will only respond to these links while in a specific waiting state)
So answer me this, if you can, Whats the 'popular' method of handling them or better yet Whats the 'best' (subjective - I know) way to do it?
Although your answers don't need to be specific to my language, I am using Delphi for development.
Thanks!
Why not use the regular urls? http://localhost/myhandler/collection/of/strings. To the best of my knowledge custom protocols only work for IE and you still need to install the handler on the client computer.
In the past I used custom protocols in one of my projects to support laptops working offline, but it was back in the time when installing IIS on a laptop was a call for trouble. but now - what's the point?