473,320 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

socket creation

Can i create 4 sockets on same ip address with different portnumbers.
I am working on windows mobile.
Jun 27 '08 #1
15 1792
ud**********@gmail.com wrote, On 05/05/08 14:24:
Can i create 4 sockets on same ip address with different portnumbers.
I am working on windows mobile.
You will have to ask in one of the Windows groups since this is system
specific.
--
Flash Gordon
Jun 27 '08 #2
On 5 May 2008 at 13:24, ud**********@gmail.com wrote:
Can i create 4 sockets on same ip address with different portnumbers.
I am working on windows mobile.
There's no reason why you shouldn't be able to. Why don't you post a
snippet of whatever code isn't working?

Jun 27 '08 #3
ud**********@gmail.com writes:
Can i create 4 sockets on same ip address with different portnumbers.
I am working on windows mobile.
By now you may have seen a followup from "Antoninus Twink" inviting
you to post your code here. Please don't. You'll get much better
answers if you post to a newsgroup that discusses your operating
system. Sockets are not a feature of the C language.

--
Keith Thompson (The_Other_Keith) <ks***@mib.org>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 27 '08 #4
On May 5, 2:24*pm, udayahirw...@gmail.com wrote:
Can i create 4 sockets on same ip address with different portnumbers.
I am working on windows mobile.
Yes, you certainly can, and you can do it portably so that your code
will compile for Linux, Windows, Solaris, Playstation 3, what have
you.

You'll need to use a cross-platform library for doing so, the big two
being pCap and "Berkeley sockets".
Jun 27 '08 #5
In article <44**********************************@l42g2000hsc. googlegroups.com>,
=?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?= <to*@lavabit.comwrote:
>On May 5, 2:24=A0pm, udayahirw...@gmail.com wrote:
>Can i create 4 sockets on same ip address with different portnumbers.
I am working on windows mobile.
>Yes, you certainly can, and you can do it portably so that your code
will compile for Linux, Windows, Solaris, Playstation 3, what have
you.
>You'll need to use a cross-platform library for doing so, the big two
being pCap and "Berkeley sockets".
If by pCap you refer to http://sourceforge.net/projects/libpcap/
then:

Operating System : All POSIX (Linux/BSD/UNIX-like OSes)

There is WinPcap, which appears to be a port that extends support
to MS Windows.

But to my mind, "what have you" includes operating systems such
as PalmOS, which is not Posix nor MS Windows, but does include
TCP/IP. Your "what have you" appears to be overly general.

--
"They called it golf because all the other four letter words
were taken." -- Walter Hagen
Jun 27 '08 #6
Walter Roberson wrote, On 05/05/08 18:37:
In article <44**********************************@l42g2000hsc. googlegroups.com>,
=?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?= <to*@lavabit.comwrote:
>On May 5, 2:24=A0pm, udayahirw...@gmail.com wrote:
>>Can i create 4 sockets on same ip address with different portnumbers.
I am working on windows mobile.
>Yes, you certainly can, and you can do it portably so that your code
will compile for Linux, Windows, Solaris, Playstation 3, what have
you.
>You'll need to use a cross-platform library for doing so, the big two
being pCap and "Berkeley sockets".
The Windows implementation of sockets is not quite the same as the
Berkeley implementation.
If by pCap you refer to http://sourceforge.net/projects/libpcap/
then:

Operating System : All POSIX (Linux/BSD/UNIX-like OSes)

There is WinPcap, which appears to be a port that extends support
to MS Windows.
It does. However, WinCE, sorry, Windows Mobile, is *not* the same as
Windows.
But to my mind, "what have you" includes operating systems such
as PalmOS, which is not Posix nor MS Windows, but does include
TCP/IP. Your "what have you" appears to be overly general.
In particular I don't believe pcap supports the target of interest to
the OP. Asking on a Windows Mobile group would be the OPs best recourse
as has already been mentioned.
--
Flash Gordon
Jun 27 '08 #7
Tomás Ó hÉilidhe wrote:
udayahirw...@gmail.com wrote:
>Can i create 4 sockets on same ip address with different
portnumbers. I am working on windows mobile.

Yes, you certainly can, and you can do it portably so that your
code will compile for Linux, Windows, Solaris, Playstation 3,
what have you.

You'll need to use a cross-platform library for doing so, the
big two being pCap and "Berkeley sockets".
Please don't reply to such off-topic queries other than to redirect
the queryier to an appropriate newsgroup. This has nothing to do
with C, and should go to some sort of windows newsgroup.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
** Posted from http://www.teranews.com **
Jun 27 '08 #8

"Tomás Ó hÉilidhe" <to*@lavabit.comwrote in message
news:44**********************************@l42g2000 hsc.googlegroups.com...
On May 5, 2:24 pm, udayahirw...@gmail.com wrote:
>Can i create 4 sockets on same ip address with different portnumbers.
I am working on windows mobile.

Yes, you certainly can, and you can do it portably so that your code
will compile for Linux, Windows, Solaris, Playstation 3, what have
you.

You'll need to use a cross-platform library for doing so, the big two
being pCap and "Berkeley sockets".

how about this:
cross-platform socket support is just a few #ifdef's away...

sadly, IME, this is often one of the "best" ways to do inter-OS portability,
namely because, most often, these cross-platform libraries, are rarely if
ever present, and even then, usually only support a few platforms and do
things that would not be so hard to pull off, simply by using ifdef's or or
occasionally swapping out source files...
Linux, Windows, and Solaris:
this should actually be fairly easy with ifdef's, since they use fairly
similar sockets interfaces.

PS3 should be likewise, since AFAIK the thing is just running linux,
likewise for XBox (modified windows core).

WinCE is also, likewise, windows... what ever differences there are in terms
of API calls, are usually noted in the help files (usually, it is
differences along the lines of special flags working, and others having no
effect, ...).
other further systems, depends on what is provided.

IMO, "universal portability" is an ill-advised goal anyways. often I have
seen a lot more damage than good done this route. usual worst case: the code
has to be ported.

worst case, if one depends too heavily on some ill-fated portability
library:
much of the app ends up having to be discarded or rewritten...
my personal advice is too keep as much platform-specific machinery as is
reasonable in small, easily replacable, source files. these can provide a
kind of app-specific portability layer.

in this case, moving between the platforms is usually a matter of using
different source files, and moving to a new one may involve tweaking the
existing ones or adding a few new ones.

this usually works a lot better than it is given credit for...

Jun 27 '08 #9

"CBFalconer" <cb********@yahoo.comwrote in message
news:48***************@yahoo.com...
Tomás Ó hÉilidhe wrote:
>udayahirw...@gmail.com wrote:
>>Can i create 4 sockets on same ip address with different
portnumbers. I am working on windows mobile.

Yes, you certainly can, and you can do it portably so that your
code will compile for Linux, Windows, Solaris, Playstation 3,
what have you.

You'll need to use a cross-platform library for doing so, the
big two being pCap and "Berkeley sockets".

Please don't reply to such off-topic queries other than to redirect
the queryier to an appropriate newsgroup. This has nothing to do
with C, and should go to some sort of windows newsgroup.
likely, one can't expect most newbs to really know the difference.
"well, I am writing in C, may as well ask the C people".

after all, many other languages (such as Java and C#, among others) include
things like sockets as part of the language, rather than as a 3rd party.

more so, a newb may not realize that most of what exists "in C" is 3rd
party, rather than being a part of the "C language".

more so, we can note that most people, may well think of programming
languages in analogy to natural languages (such as English), where a natural
language has in its propiety pretty much every concept expressable within
the language, rather than, say, the language owning the grammar, and all of
the pieces of the lexicon being 3rd party add-ons (to lookup a word, one has
to find the right dictionary for the right topic).

so, maybe one need not be too hard on newbs, or on people at least trying to
give worthwhile answers, even if not strictly on topic...

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
** Posted from http://www.teranews.com **

Jun 27 '08 #10
Flash Gordon <sp**@flash-gordon.me.ukwrites:
ud**********@gmail.com wrote, On 05/05/08 14:24:
>Can i create 4 sockets on same ip address with different portnumbers.
I am working on windows mobile.

You will have to ask in one of the Windows groups since this is system
specific.
He already had his answer. Why do you assume to be answering for other
peoples? Do you think no C programmers here have experience in real
world programs?

Jun 27 '08 #11
On May 6, 12:25*am, "cr88192" <cr88...@NOSPAM.hotmail.comwrote:
how about this:
cross-platform socket support is just a few #ifdef's away...

sadly, IME, this is often one of the "best" ways to do inter-OS portability,
namely because, most often, these cross-platform libraries, are rarely if
ever present, and even then, usually only support a few platforms and do
things that would not be so hard to pull off, simply by using ifdef's or or
occasionally swapping out source files...

Berkeley sockets is as common as white bread. Recently I was looking
into developing a networking application before I sparked a deeper
interest in embedded systems. When I asked around as to what network
library to use, I only got two responses: Berekeley Sockets or pCap.

Asking about the two, I was told that Berkeley Sockets is the bread
and butter of doing TCP or UDP communication. I was told that it's the
most implemented, most portable. I was told that if *any* network
library was available for a certain system, then Berkeley Sockets was.

pCap and the other hand is more suitable for Datalink Layer stuff,
e.g. analysing frames and handcrafting your own frames.

Linux, Windows, and Solaris:
this should actually be fairly easy with ifdef's, since they use fairly
similar sockets interfaces.

I'd got with Berekeley Sockets. Way easier, way less bug-prown to work
with.

PS3 should be likewise, since AFAIK the thing is just running linux,
likewise for XBox (modified windows core).

Berkeley again.

WinCE is also, likewise, windows... what ever differences there are in terms
of API calls, are usually noted in the help files (usually, it is
differences along the lines of special flags working, and others having no
effect, ...).

other further systems, depends on what is provided.

Again I'd go with Berkeley.

IMO, "universal portability" is an ill-advised goal anyways. often I have
seen a lot more damage than good done this route. usual worst case: the code
has to be ported.

I myself think cross-platform development is fantastic. Look at
Mozilla Firefox or Mozilla Thunderbird. I'd love to write an
application once and to have it work on all sorts of systems.

worst case, if one depends too heavily on some ill-fated portability
library:
much of the app ends up having to be discarded or rewritten...

You can make an allegation of "ill-fated" against any library. Things
like Berkeley Sockets and wxWidgets aren't about to die out -- they're
thriving.

my personal advice is too keep as much platform-specific machinery as is
reasonable in small, easily replacable, source files. these can provide a
kind of app-specific portability layer.

I beg to differ.

in this case, moving between the platforms is usually a matter of using
different source files, and moving to a new one may involve tweaking the
existing ones or adding a few new ones.

this usually works a lot better than it is given credit for...

But it involves writing more than one chunk of code, which in turn can
result in a bug only being present on one kind of system.

There's a great book for cross-platform programming entitled "Cross-
platform development in C++".
Jun 27 '08 #12
Hello List

I am working with this one:

http://pnet6.sourceforge.net/

Support lots of Unix's, Windows, Linux and MAC OS X. Just fine to me.

Regards
Rafael
Jun 27 '08 #13
Eligiusz Narutowicz <el*************@hotmail.comwrote:
Flash Gordon <sp**@flash-gordon.me.ukwrites:
ud**********@gmail.com wrote, On 05/05/08 14:24:
Can i create 4 sockets on same ip address with different portnumbers.
I am working on windows mobile.
You will have to ask in one of the Windows groups since this is system
specific.

He already had his answer. Why do you assume to be answering for other
peoples? Do you think no C programmers here have experience in real
world programs?
I could walk into a local 7-Eleven and run into people who could answer the
question. The problem is that if he is wrong, what are the odds somebody
else in the store will be able to correct him?

It's a favor to the OP to direct him to a proper newsgroup, where he can
obtain _better_ advice, not just _any_ advice.

Jun 27 '08 #14
cr88192 <cr*****@nospam.hotmail.comwrote:
<snip>
so, maybe one need not be too hard on newbs, or on people at least trying
to give worthwhile answers, even if not strictly on topic...
It's a disservice to answer off-topic questions, because it's misleading the
OP. The OP may or may not get a correct or sufficient answer. But he most
assuredly will lose the benefit of the remainder of the group critiquing and
commenting on the accuracy of any answer.

Such a benefit is what makes Usenet distinct from Google. That distinction
may be lost on people who think Usenet is just a way to get other people to
do your own work for you, or who have poor research/Googling skills. All the
more reason to make sure they realize what can actually be had, other than
quick and shoddy answers.

Jun 27 '08 #15
cr88192 wrote:
"Tomás Ó hÉilidhe" <to*@lavabit.comwrote
udayahirw...@gmail.com wrote:
>>Can i create 4 sockets on same ip address with different
portnumbers. I am working on windows mobile.

Yes, you certainly can, and you can do it portably so that your
code will compile for Linux, Windows, Solaris, Playstation 3,
what have you.

You'll need to use a cross-platform library for doing so, the
big two being pCap and "Berkeley sockets".

how about this:
cross-platform socket support is just a few #ifdef's away...
How about refraining from confusing newbies by answering off-topic
questions? Tell them it is off topic; tell them why; and, if
possible, tell them where to go. That will avoid possibly
erroneous answers appearing without corrections.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
** Posted from http://www.teranews.com **
Jun 27 '08 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Guillaume Brocker | last post by:
Hi ! I'm opening a socket to a web server on port 80 located on my LAN with fsockopen. The socket creation fails and PHP returns "php_network_getaddresses: getaddrinfo failed: Name or service...
4
by: Wenslauw | last post by:
I have a thread that reads from a socket and I want to put the data that's read into a JTextArea in my gui. What would be the prettiest way of doing this? Listeners? Passing the JTextArea to the...
5
by: Russell Warren | last post by:
Does anyone know the scope of the socket.setdefaulttimeout call? Is it a cross-process/system setting or does it stay local in the application in which it is called? I've been testing this and...
3
by: thomson | last post by:
Hi all, please help me out "IF 25000 users request a yahoo page, will 25000 sockets will be created" For the Server to know which client has requested what there has to be a socket with the...
4
by: Rain | last post by:
Im using Socket Server and im looking for a way to make my application more efficient. Any help, ideas, suggestions would be very much appreciated. Here's my problem: Since im using socket...
1
by: Mike Read | last post by:
Hi I'm trying to track down why the creation of socket connections on my system is taking several minutes. I initially noticed this when attempting a JDBC connection but even the simple ...
9
by: zxo102 | last post by:
Hi everyone, I am using a python socket server to collect data from a socket client and then control a image location ( wxpython) with the data, i.e. moving the image around in the wxpython frame....
1
by: Alper AKCAYOZ | last post by:
Hello, I have developped asynchronous socket communication with blocking Socket commands (accept, connect, send, receive) by using threads on Windows .NET Forms. It is working properly. Now I...
2
by: Steve Walton | last post by:
We have a little server application that sends data down to a client application via a TCP/IP socket over port 30006. These applications are both written in C#. They have been working on our site...
2
by: apollo135 | last post by:
Dear All, Could someone help and tell me how to handle multiple send and receive operations with udp sockets? In fact here is my problem: server.c is composing of serveral sub programs (the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.