java - ServerSocket connecting to itself more than once -


question: can computer, acts server, connect more once socket?

background: i'm designing game java class involves networking. far in code, have 1 computer host game via serversocket while computer connects via socket. debugging purposes, have been hosting server , connecting server on same computer. make serversocket on port 3333 instance, create socket connecting port 3333; , on same machine , ip address. however, have noticed anytime try make more 1 socket connection on same machine, 2 sockets both connect same serversocket on same machine, previous socket connection closed. why that? reason doing way make life simpler when comes code; way, can make host act client , reuse code instead of implementing new 1 client host-sided.

question: can computer, acts server, connect more once socket?

yes. long accepting side implemented normally, i.e. handle multiple clients, computer doesn't care clients coming from.


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -