Click here to Skip to main content
15,891,136 members
Home / Discussions / Mobile
   

Mobile

 
GeneralCross platform GUI Pin
NewtonOfComputers13-Jun-04 21:19
NewtonOfComputers13-Jun-04 21:19 
GeneralRe: Cross platform GUI Pin
Henry miller15-Jun-04 8:41
Henry miller15-Jun-04 8:41 
GeneralOnoard C# programming Pin
Vitaliy Pronkin12-Jun-04 9:01
Vitaliy Pronkin12-Jun-04 9:01 
Generalopening mobile Pin
emysola11-Jun-04 20:27
emysola11-Jun-04 20:27 
Generalincremental installation of C# applications Pin
ting66810-Jun-04 16:25
ting66810-Jun-04 16:25 
GeneralXML upload from PDA to PC ,HEP!!! Pin
apenon10-Jun-04 9:41
apenon10-Jun-04 9:41 
GeneralRe: XML upload from PDA to PC ,HEP!!! Pin
Richard Jones8-Jul-04 4:58
Richard Jones8-Jul-04 4:58 
QuestionCan someone help me to work around the reuseaddress problem? Pin
Adriano Albertini10-Jun-04 6:18
Adriano Albertini10-Jun-04 6:18 
Hi all ,
i'm trying to realize a CF C# application that uses udp protocol and multicasting on address 224.0.1.84.
I need to have different sockets that reuse the same address and port, so i need to set the reuseAddress parameter with the setSocketOption function to true.
Unfortunely there is a bug in the API and the function with such a parameter doesn't work.
As Microsoft say you can work around this problem calling directly the CE API with the P\Invoke way.
I tried to do so, but with no result.
I always obtain error "10038" from the CE function setsockopt, which means that the function does't recognize the pointer passed a socket pointer. I'm sure i'm passing a valid socket pointer.
This is my code..

[DllImport("Winsock",EntryPoint="setsockopt", CharSet=CharSet.Unicode, SetLastError=true)]

public extern static int setsockopt(IntPtr _sock, SocketOptionLevel level, SocketOptionName name, byte [] byte_val, int int_val);

...

Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);

IntPtr _sockhandle = sock.Handle;
MessageBox.Show(_sockhandle.ToString(), "socketHandle..");
if(this.setReuse(_sockhandle))
{
MessageBox.Show("setReuse OK!!");
....
}

...

private bool setReuse(IntPtr _sock)
{
int rs = 0;
try
{
Byte[] one = new Byte[1];
rs = setsockopt(_sock, SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, one, 4);
}
catch(Exception e)
{
MessageBox.Show(e.ToString(), "setReuse error..");
}

if (rs == mySOCKET_ERROR)
{
MessageBox.Show("setReuse error: " + rs.ToString() + " - " + Marshal.GetLastWin32Error().ToString());
return false;
}
else
{
MessageBox.Show("setReuse OK: " + rs.ToString());
return true;
}
}

What is wrong?

I tried too to call the CE API socket function in order to obtain a socket handle..

[DllImport("Winsock",EntryPoint="socket", CharSet=CharSet.Unicode,SetLastError=true)]

public extern static IntPtr mySocket(int af, int type, int protocol);

using it in this way

IntPtr _sockhandle = mySocket(2, 2, 17);

and passing it to the setsockopt..

in this way the function works, but now how can i associate this handle to a CF socket?
The socket.handle property is readonly and there is no constructor to create a new socket from a IntPtr handle..

Thank you very much!! Smile | :)
QuestionHow to write a MIDI (type 0) player in SmartPhone 2002 Pin
gurusg9-Jun-04 19:39
gurusg9-Jun-04 19:39 
QuestionHow to get emulator to setup socket connect via serial port ? Pin
glweid9-Jun-04 11:59
glweid9-Jun-04 11:59 
GeneralBeep for pocketPC?. Pin
GDavy9-Jun-04 2:47
GDavy9-Jun-04 2:47 
GeneralRe: Beep for pocketPC?. Pin
João Paulo Figueira9-Jun-04 3:11
professionalJoão Paulo Figueira9-Jun-04 3:11 
General'vcw' Projects that will not load Pin
LittleYellowBird8-Jun-04 22:42
LittleYellowBird8-Jun-04 22:42 
GeneralNeed a small advice regarding strings Pin
no_reg_name8-Jun-04 0:42
no_reg_name8-Jun-04 0:42 
GeneralRe: Need a small advice regarding strings Pin
Jonas Larsson8-Jun-04 1:08
Jonas Larsson8-Jun-04 1:08 
GeneralRe: Need a small advice regarding strings Pin
Antony M Kancidrowski8-Jun-04 3:07
Antony M Kancidrowski8-Jun-04 3:07 
Generalimage data type, sql server ce 2.0 Pin
khchan7-Jun-04 16:07
khchan7-Jun-04 16:07 
GeneralInstrumentation widgets / gadgets for CE .Net 4.2 Pin
David Fulmer7-Jun-04 5:13
David Fulmer7-Jun-04 5:13 
GeneralRe: Instrumentation widgets / gadgets for CE .Net 4.2 Pin
Edw21-Jun-04 10:03
Edw21-Jun-04 10:03 
QuestionHow to make a setup that can install appropriate files on Pocket PC 2002 or 2003 Pin
Bui Huy Kien4-Jun-04 19:17
Bui Huy Kien4-Jun-04 19:17 
Generallaunch application in application and close it Pin
ppp0013-Jun-04 21:34
ppp0013-Jun-04 21:34 
GeneralC# performance Pin
ppp0013-Jun-04 7:34
ppp0013-Jun-04 7:34 
GeneralRe: C# performance Pin
João Paulo Figueira3-Jun-04 11:41
professionalJoão Paulo Figueira3-Jun-04 11:41 
GeneralC4925: INTERNAL COMPILER WARNING Pin
GDavy2-Jun-04 21:43
GDavy2-Jun-04 21:43 
Generalembedded visual c++ Pin
jetimms2-Jun-04 7:22
jetimms2-Jun-04 7:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.