Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Page: previous  1  2 
Avatar
mikrixara #16
Member since Oct 2009 · 6 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 4411
Ok this was the problem and now it works!

Thank you very much Alex!!!
Avatar
ichi.naito #17
Member since Nov 2010 · 6 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 3924
Subject: Unable connect to server....
sir alex....
i made some trial mobile program using agsXMPP SDK for my Windows Mobile 6.1.  the problem is "it can't connect to server". i use "jabber.org" as my trial server.. You can look my all code below,,,

using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using agsXMPP.protocol.client;
using agsXMPP.Collections;
using agsXMPP.protocol.iq.roster;
using agsXMPP;


namespace SmartDeviceProject1
{
    public partial class Form1 : Form
    {

        XmppClientConnection xmpp = new XmppClientConnection();
        delegate void OnPresenceDelegate(object sender, Presence pres);
        delegate void OnMessageDelegate(object sender, agsXMPP.protocol.client.Message msg);
        public Form1()
        {
            InitializeComponent();
        }

        private void menuItem1_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void menuItem2_Click(object sender, EventArgs e)
        {
          
        }

        void xmpp_OnLogin(object sender)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new agsXMPP.ObjectHandler(xmpp_OnLogin), new object[] { sender });
                return;
            }
            //throw new NotImplementedException();
            menuItem3.Enabled = false;
            menuItem4.Enabled = true;

        }

        private void menuItem3_Click(object sender, EventArgs e)
        {
            try
            {
                xmpp.Username = "myblack.kyo";
                xmpp.Password = "system32";
                xmpp.Server = "jabber.org";
                xmpp.Open("myblack.kyo", "system32");
                xmpp.Priority = 1;
                xmpp.Port = 5222;
                xmpp.ClientSocket.Connect();
                xmpp.Show = agsXMPP.protocol.client.ShowType.NONE;
                xmpp.UseCompression = false;
                xmpp.UseStartTLS = false;
                xmpp.Open();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);

            }
        }

        void xmpp_OnClose(object sender)
        {
            if (InvokeRequired)
            {
                // Windows Forms are not Thread Safe, we need to invoke this :(
                // We're not in the UI thread, so we need to call BeginInvoke               
                BeginInvoke(new agsXMPP.ObjectHandler(xmpp_OnClose), new object[] { sender });
                return;
            }
            menuItem3.Enabled = true;
            menuItem4.Enabled = false;
            //throw new NotImplementedException();
        }

        void xmpp_OnMessage(object sender, Message msg)
        {
            if (InvokeRequired)
            {
                // Windows Forms are not Thread Safe, we need to invoke this :(
                // We're not in the UI thread, so we need to call BeginInvoke               
                BeginInvoke(new OnMessageDelegate(xmpp_OnMessage), new object[] { sender, msg });
                return;
            }
            if (msg.Type == MessageType.chat)
            {
                label2.Text+=msg.From.User+">"+msg.Body+"\n";
            }
            //throw new NotImplementedException();
        }

        void xmpp_OnPresence(object sender, Presence pres)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new OnPresenceDelegate(xmpp_OnPresence),new object[] {sender,pres});
                return;
            }
            //throw new NotImplementedException();
            if (pres.Type==PresenceType.available)

            {
                label1.Text += "\n >" + pres.From.User + "@" + pres.From.Server;
            }
          
               

         

        }

        private void menuItem4_Click(object sender, EventArgs e)
        {
            xmpp.Close();
        }

        private void menuItem5_Click(object sender, EventArgs e)
        {
            xmpp.Send(new Message("ichi.naito@jabber.org",MessageType.chat,"XMPP test and try"));
        }

        private void menuItem6_Click(object sender, EventArgs e)
        {
           
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            xmpp.OnLogin += new ObjectHandler(xmpp_OnLogin);
            xmpp.OnPresence += new PresenceHandler(xmpp_OnPresence);
            xmpp.OnMessage += new MessageHandler(xmpp_OnMessage);
            xmpp.OnClose += new ObjectHandler(xmpp_OnClose);
        }
    }
}

the other problem is it cannot open internet connection in my mobile phone ... :(
soo.. idont have  any idea to resolve my problem,,, can you help me sir... please....

thanks....
Avatar
Alex #18
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by ichi.naito:
the other problem is it cannot open internet connection in my mobile phone ... :(
soo.. idont have  any idea to resolve my problem,,, can you help me sir... please....

When you have no Internet connection on the emulator then you can't connect to your xmpp server.
You first have to get Internet running on the emulator over Active Sync or the Windows Mobility Center.
Try first if you can load a webpage on IE on the emulator.

Alex
Avatar
ichi.naito #19
Member since Nov 2010 · 6 posts
Group memberships: Members
Show profile · Link to this post
Quote by Alex:
When you have no Internet connection on the emulator then you can't connect to your xmpp server.
You first have to get Internet running on the emulator over Active Sync or the Windows Mobility Center.
Try first if you can load a webpage on IE on the emulator.

Alex

thanks about your response sir....
but i'm not use emulator in this case.... i just use my windows mobile phone (Win 6.1 standard edition)..
i just copied my build directory (release), to my mobile phone... and run it any way....

i just see the form and without any error messages.... but my XMPP client still couldn't connect to server (even internet connection have been opened).....
i thought there is must be something missed by me....
do you have any idea sir???? please help me anyone ,,, thiz iz for my graduation.... :(
Avatar
Alex #20
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
sorry, but without any logfiles I can't help you.
Avatar
ichi.naito #21
Member since Nov 2010 · 6 posts
Group memberships: Members
Show profile · Link to this post
Quote by Alex:
sorry, but without any logfiles I can't help you.

Im sorry sir,, actually i'm a newbie for this....... would you like to explain about log files????
thanks.....
Avatar
Alex #22
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by ichi.naito:
Im sorry sir,, actually i'm a newbie for this....... would you like to explain about log files????
see:
http://forum.ag-software.de/thread/721-How-can-I-post-my-Debug-XML
Avatar
ichi.naito #23
Member since Nov 2010 · 6 posts
Group memberships: Members
Show profile · Link to this post
Quote by Alex on 2010-11-28, 11:42:
Quote by ichi.naito:
Im sorry sir,, actually i'm a newbie for this....... would you like to explain about log files????
see:
http://forum.ag-software.de/thread/721-How-can-I-post-my-Debug-XML

i try to create my jabber application at my mobile phone samsung valencia (Win Mobile 6.1 Standard)..
i use your library (agsXMPP) and still doesnt work... i check my internet connection,, and the connection manager show the internet connection still closed....
My phone use dial up connetion to connect to internet...
can you show me the way,, how can i dial the internet from my listing program???
thanks.....
Avatar
Alex #24
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
sorry but I don't know how you can dial the internet connection from c#.
A working internet connection is required before agsXMPP can connect to the XMPP server. Is there no setting in the phone which dials automatically whenever a program requires a connection?

Alex
Avatar
ichi.naito #25
Member since Nov 2010 · 6 posts
Group memberships: Members
Show profile · Link to this post
Quote by Alex:
sorry but I don't know how you can dial the internet connection from c#.
A working internet connection is required before agsXMPP can connect to the XMPP server. Is there no setting in the phone which dials automatically whenever a program requires a connection?

Alex

im understood now,,,, but my phone just has GPRS , no wifi or any other...
but the weird is if internet browser active and navigate to any address, the internet connection going to be activate ...
any idea from this weirdness sir???
:(
thanks....
Avatar
ichi.naito #26
Member since Nov 2010 · 6 posts
Group memberships: Members
Show profile · Link to this post
Subject: My problem resolved.... but ags xmpp still doesnt work....
Im so happy....
i just resolve my connection problem about the dial up connection......
 i used opennetCF sdk.... thats good SDK...... it activate the GPRS connection in one touch and close it automatically,,,, very2 nice SDK ..hihihi..  :)
here the source code,,, i woukd like share with you all....

using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using OpenNETCF.Net;

namespace GPRS
{
    public partial class Form1 : Form
    {
        private ConnectionManager m_manager;
        private DestinationInfoCollection m_destinations;
        private ConnectionDetailCollection m_detailCollection;
        public Form1()
        {
            InitializeComponent();
            try
            {
                m_manager = new OpenNETCF.Net.ConnectionManager();
            }
            catch (PlatformNotSupportedException)
            {
            }
            if (m_manager.SupportsStatusNotifications)
            {
                m_detailCollection = m_manager.GetConnectionDetailItems();
                m_detailCollection.ConnectionDetailItemsChanged += new ConnectionStateChangedHandler(m_detailCollection_ConnectionDetailItemsChanged);
            }
            else
            {
                m_manager.ConnectionStateChanged += new ConnectionStateChangedHandler(m_manager_ConnectionStateChanged);
            }
            RefreshDestinations();
           
        }

        void m_manager_ConnectionStateChanged(object source, ConnectionStatus newStatus)
        {
            throw new NotImplementedException();
        }

        void m_detailCollection_ConnectionDetailItemsChanged(object source, ConnectionStatus newStatus)
        {
            throw new NotImplementedException();
        }
        private void RefreshDestinations()
        {
            m_destinations = m_manager.EnumDestinations();
            try
            {
                foreach (DestinationInfo dest in m_destinations)
                {
                    label1.Text = dest.Description;
                    label2.Text = dest.Guid.ToString();
                    m_manager.Connect(dest.Guid, true, ConnectionMode.Asynchronous);
                }
          
            }
            catch (Exception ex1)
            {
               
            }
            m_manager.Connected += new EventHandler(m_manager_Connected);
     
        }

        void m_manager_Connected(object sender, EventArgs e)
        {
            label3.Text = "Connected";
            //throw new NotImplementedException();
        }

        private void menuItem1_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }


that just the source code,, if your smartphone just got a dialup connection.... Just take a good for all ... hihihihihi
i hope this source code helpful for all of you broo....

but why the AgsXMPP still cant connect to the xmpp server???? i just compare it with IPWORKS trial version,,,,and it works...

and when i tried agsxmpp library,, it still cant work..... may be someone can help me????
please...??? thanks
Avatar
Alex #27
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Please post your code you use to connect to the XMPP server. And your Xml logs if there are any.

Alex
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Page: previous  1  2 
Forum: agsXMPP RSS