problem connecting to red5 "firstApp" from librtmp - red5

I am trying to connect to Red5 tutorial "firstApp" application from libRTMP client.
Note that I can connect to it from flex client, as tutorial describes:
...
//from flex client
NetConnection nc = new NetConnection();
nc.connect("rtmp://localhost/firstApp"); - connected, works
//from libRTMP
RTMP* r = RTMP_Alloc();
retVal = RTMP_SetupURL(r, "rtmp://localhost/firstApp");
retVal = RTMP_Connect(r, NULL); - no connection
retVal = RTMP_SetupURL(r, "rtmp://localhost:1935/firstApp");
retVal = RTMP_Connect(r, NULL); - still no connection
//The same thing works fine for Red5 "live" application
retVal = RTMP_SetupURL(r, "rtmp://localhost:1935/live/instance");
retVal = RTMP_Connect(r, NULL); - works, connected
Any ideas what the problem might be?
Thank you,
-V

Can you take a look at logs? Perhaps librtmp still send "live" as a name of application.

Is there an installed and configured application named "firstApp" inside your red5 webapps directory?

try "rtmp://localhost/firstApp/definst" as the URL

The RTMP URL format is of the form
rtmp[t][e|s]://hostname[:port][/app[/playpath]]
Reference : http://rtmpdump.mplayerhq.hu/librtmp.3.html

Eventually solved my problems with another open source RTMP project "crtmpserver" (http://www.rtmpd.com), which seems to be far better designed, documented, implemented and maintained.

Related

Error when I try to connect DI-API oCompany object to my database in SAP B1

I am trying to connect to a production database from a C# console project in .NET6 with VS 2022 using this piece of code
using SAPbobsCOM;
void InsertarActividad()
Company oCompany = new Company();
oCompany.Server = "IP_Server";
oCompany.CompanyDB = "DEMO";
oCompany.UserName = "manager";
oCompany.Password = "XXXXXX";
oCompany.DbUserName = "sa";
oCompany.DbPassword = "XXXXXX";
oCompany.DbServerType = BoDataServerTypes.dst_MSSQL2012;
oCompany.LicenseServer = "IPServer:30000";
int rdoConexion = oCompany.Connect();
oCompany.StartTransaction();
try
{
In rdoConnection variable I get a value of -10 and according to other code examples I think the value should be 0 because when I start the transaction it tells me that I am not connected
System.Runtime.InteropServices.COMException: ‘You are not connected to a company’
The values of oCompany are correct and in fact in an old VB.NET application that I am migrating they work and I don't know the reason why now in the same local network of the office in this project it does not connect me
Any ideas, please?
Thanks
It has been fixed by replacing the server IP with its name. I don't know why this is so but at least it connects me
Thanks

How to fix No I2c device exists for bus ID1 (GrovePi .net core)

I'm making a .net core API to control the led lights from my pi, but I'm facing the following error: System.ArgumentException:
No I2C device exists for bus ID 1.
I tried to find some info on how to find the busid of the grovepi but didn't came far. Tried also numbers 1 to 5 also didn't came far.
This is my code:
[1] https://gyazo.com/aa01ab3068201360c3ece14f125b1c45
My error:
[2] https://gyazo.com/6bf3215e4466b02643b6a9eb92d12e52
I expected to turn the light on and get a page with some text but I keep getting the same error.
I can reproduce this issue. I tracked the exception, it is thrown here. I posted an issue(#590) in GitHub.
public Windows10I2cDevice(I2cConnectionSettings settings)
{
_settings = settings;
var winSettings = new WinI2c.I2cConnectionSettings(settings.DeviceAddress);
string busFriendlyName = $"I2C{settings.BusId}";
string deviceSelector = WinI2c.I2cDevice.GetDeviceSelector(busFriendlyName);
DeviceInformationCollection deviceInformationCollection = DeviceInformation.FindAllAsync(deviceSelector).WaitForCompletion();
if (deviceInformationCollection.Count == 0)
{
throw new ArgumentException($"No I2C device exists for bus ID {settings.BusId}.", $"{nameof(settings)}.{nameof(settings.BusId)}");
}
_winI2cDevice = WinI2c.I2cDevice.FromIdAsync(deviceInformationCollection[0].Id, winSettings).WaitForCompletion();
if (_winI2cDevice == null)
{
throw new PlatformNotSupportedException($"I2C devices are not supported.");
}
}
As we know, .net core 3.0 for IoT is preview. May i know why don't you consider to use traditional way to do that? A workaround is, you can host a web server in a UWP app, and you can add the LED control in the UWP app. Please refer to IoTWeb.

Application name is not set. Call Builder#setApplicationName. error

Application: Connecting to BigQuery using BigQuery APIs for Java
Environment: Eclipse, Windows 7
My application was running fine until last night. I've made no changes (except for restarting my computer) and my code is suddenly giving me this error:
Application name is not set. Call Builder#setApplicationName.
Thankfully I had a tar'd version of my workspace from last night. I ran a folder compare and found the local_db.bin file was different. I deleted the existing local_db.bin file and tried to run the program again. And it worked fine!
Any idea why this might have happened?
Hopefully this will help anyone else who stumbles upon this issue.
Try this to set your application name
Drive service = new Drive.Builder(httpTransport, jsonFactory, null)
.setHttpRequestInitializer(credential)
.setApplicationName("Your app name")
.build();
If you are working with only Firebase Dynamic Links without Android or iOS app
Try this.
builder.setApplicationName(firebaseUtil.getApplicationName());
FirebaseUtil is custom class add keys and application name to this class
FirebaseDynamicLinks.Builder builder = new FirebaseDynamicLinks.Builder(
GoogleNetHttpTransport.newTrustedTransport(), JacksonFactory.getDefaultInstance(), null);
// initialize with api key
FirebaseDynamicLinksRequestInitializer firebaseDynamicLinksRequestInitializer = new FirebaseDynamicLinksRequestInitializer(
firebaseUtil.getFirebaseApiKey());
builder.setFirebaseDynamicLinksRequestInitializer(firebaseDynamicLinksRequestInitializer);
builder.setApplicationName(firebaseUtil.getApplicationName());
// build dynamic links
FirebaseDynamicLinks firebasedynamiclinks = builder.build();
// create Firebase Dynamic Links request
CreateShortDynamicLinkRequest createShortLinkRequest = new CreateShortDynamicLinkRequest();
createShortLinkRequest.setLongDynamicLink(firebaseUtil.getFirebaseUrlPrefix() + "?link=" + urlToShorten);
Suffix suffix = new Suffix();
suffix.setOption(firebaseUtil.getShortSuffixOption());
createShortLinkRequest.setSuffix(suffix);
// request short url
FirebaseDynamicLinks.ShortLinks.Create request = firebasedynamiclinks.shortLinks()
.create(createShortLinkRequest);
CreateShortDynamicLinkResponse createShortDynamicLinkResponse = request.execute();

Upload file to share point server from external application

My client has requested to upload files to his share point server from and external application. So I have designed a windows application and used Microsoft.sharepoint.dll supplied by client and used the following code for upload.
Public Function UploadFileToSharepoint(ByVal pstrSourceFilePath As String, ByVal pstrTargeSPURL As String) As Boolean
If Not File.Exists(pstrSourceFilePath) Then
Throw New ArgumentException(String.Format("{0} does not exist", pstrSourceFilePath), "srcUrl")
End If
Dim site As SPWeb = New SPSite(pstrTargeSPURL).OpenWeb()
Dim fStream As FileStream = File.OpenRead(pstrSourceFilePath)
Dim contents(CInt(fStream.Length)) As Byte
fStream.Read(contents, 0, CInt(fStream.Length))
fStream.Close()
EnsureParentFolder(site, pstrTargeSPURL)
site.Files.Add(pstrTargeSPURL, contents)
Return True
End Function
I am able to compile it but while running the application I am getting an error like "Could not load or found an assembly "Microsoft.Sharepoint.Library.dll".
My question: Is it possible to develop an application to create a folder structure and upload the file to share point server without having the share point installed on the machine but having only the share point dll's?
Suggest me a way to carry out this kind of development. In future my application will run on a machine where share point server is not installed.
Rupesh
Yes, you can do that using Client Object Model - just reference Microsoft.SharePoint.Client in your project. Here's how to do it in C#, VB.net shouldn't be much different.
ClientContext context = new ClientContext("http://mydomain");
Web web = context.Web;
FileCreationInformation newFile = new FileCreationInformation();
newFile.Content = System.IO.File.ReadAllBytes(#"C:\MyFile.docx");
newFile.Url = "MyFile.docx";
List docs = web.Lists.GetByTitle("Documents");
Microsoft.SharePoint.Client.File uploadFile = docs.RootFolder.Files.Add(newFile);
context.Load(uploadFile);
context.ExecuteQuery();
You should look into using the SharePoint Client-Side Object model (CSOM). That will allow you to interact with SharePoint from a client.
More info here --> http://msdn.microsoft.com/en-us/library/office/ee535451(v=office.14).aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1

AIR sqlite asynchronous database connection?

function openDatabase():void
{
var dbFile:File = File.applicationStorageDirectory.resolvePath("database.db");
connection = new SQLConnection();
connection.addEventListener(SQLEvent.OPEN, onOpen);
connection.openAsync(dbFile, "create");
}
i used this code in AIR to create connection and it's working but where is the database file??
where is the applicationStorageDirectory??
It's platform dependent (Mac, Windows, etc.). If you print out the value of "File.applicationStorageDirectory.nativePath", it will give you the fully-specified path on the filesystem of your current platform.